You can simulate this in shaders or use raycasts to see if the light is behind a wall.
Light goes through walls unity.
You have a point light source behind some walls.
Is there a way to stop the light going through walls.
Then click on your light click on the culling mask dropdown then uncheck the layer the object is on.
You ll notice the walls have a greater gradient of color now.
Although you have enclosed the light indirect light from the light source seems to seep through especially on the ceiling and the floor.
That s why shadows exist.
Place it just behind your wall so that it blocks the light from leaking out.
Shadows are the obvious answer however i assume you are using lite and that s not an option.
I am in a room where there is no light and i can see the light coming from the next.
Unity can set it and forget it rather than continuously having to readjust the lighting effects.
Open window lighting scene and turn the ambient intensity to 0 and reflection intensity to 0 to get rid of the default ambient lighting.
Now the light will not affect the object.
Light going through wall.
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.
This also lowers the performance cost of lighting.
On why there is still a slight light in your scene despite the walls that s unity s environment lighting.
In that case you ll need to be a bit more clever.
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.