September 23, 2022, 3:10am
I want to attach a spotlight to a camera which would move with movement to the camera, to emulate a torch and was wondering if someone could point me in the right direction. I’m using the universal camera btw.
September 23, 2022, 5:09am
This looks like a similar thread
@Alvin_Stefanus , how are you doing?
I took you playground and modified it to use SpotLights, the trick is to also set the directions appropriately when moving the light around, since your object is in the center you can do that by always setting the direction to be the inverse of the light position. Otherwise, you would have to subtract the light position from the target mesh position.
Babylon.js Playground (babylonjs-playground.com)
@lukaku just checking in if you need any more help.