Collision with spot light


Together with a friend, i am making a game, in which we need an object to be able to colid with a spotlight. is this possible somehow with logic bricks or simple phyton (in that case, we will need some more help!) and will our object be able to hide behind, say, a box without coliding with the light, because he is standing in the shadow.

Thanks in advanced!

The easiest way to add collision to immaterial objects is to parent them to empties, and set the empties to collide. However, I have found that it is more useful to use a cube, or whatever shape, and just delete faces only. Then, it is invisible like empties, but you can add materials, to adjust DYN.

Also, a warning, Realtime light and shadows can take a heavy toll on CPU usage. I would recommend using them sparsely, only in important places, where it would have the most effect.

oh yearh, we thought about that. but the object does behave like light. The lightobject can go trough walls and stuff where light would bounce off, leaving a shadow behind.

that is i tricky one
i would be interested to see if you can do it
the only way i could think of is if there is some way in python to tell how much light is on a object

yearh I thought so… hmm.

The easiest thing to do would be to cast a ray from the object to the spotlight, and if the ray hits anything consider the object to be in shadow; this only considers the object’s center though, so if light were on a different part of the object it wouldn’t register.