Hi im trying to set up the car lights, but when i try to set the spotlight to the floor in front of the car it always target the point (0,0,0) nothing seems to modify that.
I’ve tried:
- spotlight.target.position.set(x,y,z);
-spotlight.target.updateMatrix();
I would aprecciate if you have any solution to do this quickly.
Thanks in advice.
https://threejs.org/docs/index.html#api/lights/SpotLight
Use
scene.add(light.target)
thenscene.add(light)
. (scene.add(light.target, light)
is also fine).If you do this the other way around, the spotlight will target the default of (0,0,0).