Now the light will not affect the object.
Lights going through walls unity.
I am using gaia for the terrain and have the lighting set to afternoon light for those familiar with the program.
Hi all i have a basic pb building and in each end of the room the directional light seems to be shining through the walls even though i have shadows set to two sided.
Place it just behind your wall so that it blocks the light from leaking out.
It s really just a shadow type setting that needs to be set right.
The layers are the dropdown box in the upper right of the inspector.
Create a unity primitive cube plane etc sized similarly to your wall remove its collider and in the mesh renderer properties set it to shadows only.
However if you can section things off into rooms then disabling the lights not in your room will solve this.
Here is how to fix it.
This is a quick fix for the light bleed that i was having a while ago.
Although you have enclosed the light indirect light from the light source seems to seep through especially on the ceiling and the floor.
Then click on your light click on the culling mask dropdown then uncheck the layer the object is on.
Since you re using unity free put the plane on a specific layer.
That s why shadows exist.
Published on nov 2 2017 you have a point light source behind some walls.
These options have obvious edge cases that can t be easily resolved.
You can simulate this in shaders or use raycasts to see if the light is behind a wall.
This solution works in other engines like unity and ue4.