- Home /
Spot light from moving object to static object
Hallo Community,
I have a question regarding the spot light function. I would like to use a spot light to light from a moving object to a static object (fixed spot light installed at a moving car has to light up always the same static object on the ground, as it is like a symbol on the ground it can be lit from all directions). I think applying transform.lookAt helps me to to point at the static object at the beginning.
My spot light is of course set as part of the moving object (car), but of course I have to dynamically set the range of the spot light, angle based on the current position of the moving object. Is there an easy way to code this fixed lighting at a static object, or is it necessary to mathematically derive the relation between both objects (then e.g. using transform.rotate) to always set direction and range requirements within a C#-update function such that my spotlight correctly points at my static object? Any idea is appreciated !
Best regards, Lukas Best regards, Lukas