To make lights do not go through the wall??

hi there, i want to make a scene with a point(or other lights) light,the point light is outside a closed room,there is a window on one of the room’s
wall,question is i want to make the point light don’t go through the wall but only go through the window,possible to do this?? thanks for hints!!

Either use real-time shadows (if you have Pro), or bake lighting and shadows in a 3D app, and don’t use lights in Unity.

–Eric

Another possible option is to put a cookie on a spotlight coming through the window… done correctly, it can create the illusion that the light coming through the window is in the shape of the window, rather than just a round spotlight.

Using the spotlight/cookie approach works well, but you also have to put the room interior walls that you don’t want fully lit on their own layer and have the main external light (sun, moon, whatever) ignore the interior layer.

What I did was place a light with cookie at my window. Then I wrote a script to simulate the sun’s rays by aligning the spotlight orientation with the sun’s direction from the window (simply put, find the direction from the sun to the window, then use LookAt() on the spotlight so it “looks” in the same direction as the sun’s light is traveling). Then, whenever the sun moves (if you even need that kind of dynamic movement), the light will change its rotation, and the light and shadows will travel across the room accordingly. Throw in a light in the room to handle ambient lighting, too, if you want that much control.