Object Light Help

How do i make it to when a gameobject enters a trigger zone, a specified light does not affect it?

Im trying to make it to when you go on a house the sun doesnt affect you.

Any help would be greatly appreciated.

Is this even possible?

Hey There,

You can exclude a certain layer from the light’s culling mask. To do this you would need to have the player character assigned to a specific layer and then exclude that layer from your sun’s culling mask in the OnTriggerEnter() event.

A few questions that would perhaps help find a more elaborate solution:

  1. Are you using Unity Pro?
  2. I assume you are using a 3rd person camera. If so how is it positioned in relation to the player?
  3. What sort of gameplay are you going for? Perhaps the house could be a different scene altogether without a sun.

PS: Don’t be shy to share more info about your scene setup. There are tons of ways to deal with any given problem so the more you share the easier it’s for someone to think of a solution.

  • Alex

Its a FPS Rpg, and the characters and the main player’s weapon looks weird when inside and the bright sun lights them all up.