Now the light will not affect the object.
Unity light goes through walls.
Although you have enclosed the light indirect light from the light source seems to seep through especially on the ceiling.
In that case you ll need to be a bit more clever.
Then click on your light click on the culling mask dropdown then uncheck the layer the object is on.
For his situation and scene what worked best we thought was to simply set a floor2 layer on the other side of the wall and disable that layer for that light.
That s why shadows exist.
That light should not affect that hallway at all anyways so it works perfectly.
Unity 5 also made a big change in how it s shadows are rendered be sure to select your object and set cast shadows via the inspector top of mesh renderer component to two sided.
The layers are the dropdown box in the upper right of the inspector.
These options have obvious edge cases that can t be easily resolved.
Light going through wall unity answers unity is the ultimate game development platform.
Since you re using unity free put the plane on a specific layer.
My level has high walls all around it and what i want is for the 1st person controller to just bump into the walls without going through it i created the level before i heard you need to tick the generate colliders so i ticked that doesnt affect the level thats out it will make colliders but i will have to start it all over again.
The real solution would be to create walls with actual depth so it gives the shadow bias some room to work.
You can simulate this in shaders or use raycasts to see if the light is behind a wall.
Use unity to build high quality 3d and 2d games deploy them across mobile desktop vr ar consoles or the web and connect with loyal and enthusiastic players and customers.