- Home /
How to stop light passing through closed box?
Hello,My name is Abdullah and i am making this clone of minecraft (sort of) so it is nearly complete but one thing i noticed was no matter how deep i go or if i buried myself under the ground or go into underground caves the lighting would not get darker i tried it with other experiments like closing my FPSController in a box and seeing if the light passes through but still the light passes inside the closed box and it is fully lit any ideas on how this could be solved PS: i have not changed even one of the settings in the light inspector (it scares me alot).
Answer by Buckslice · Dec 04, 2017 at 06:58 PM
Hello Abdullah, my name is Bucky. Try turning shadows on in your light source. And depending on your meshes you may need to change the shadow casting mode to two-sided. Hope this helps!
Hey Bucky thanks for the answer but i tried turning on the shadows on my sun but still it does not change anything not even doing two-sided shadow on my mesh doesnot change anything i even disabled the sun but it still lights up
Post some pictures maybe of your scene / inspector so we can get a better look?
Sorry Bucky thanks for your answer i appreciate it but Remy_Unity solved my problem
Answer by Remy_Unity · Dec 05, 2017 at 09:07 AM
This may be caused by the environment lighting (also named ambiant lighting), that affects any object, regardless if it's in a closed box or not.
Look at your lighting settings : https://docs.unity3d.com/Manual/GlobalIllumination.html#Environment and try to put the environment lighting intensity to 0.
You should then have 100 black in closed areas.
Thanks man I cant thank you enough. I don't know how, but the intensity was set to full i set it to 0 and boom! it worked thanks very much
Answer by The_Pro_Programmer · Dec 05, 2017 at 07:32 AM
Hey Bucky thanks for the answer but i tried turning on the shadows on my sun but still it does not change anything not even doing two-sided shadow on my mesh doesnot change anything i even disabled the sun but it still lights up