I have an object that I want to move directly towards the camera when given the proper input.
I've taken a look at Object3d.translateOnAxis(axis, distance), but I can't seem to set the axis (the object's local axis) to always face the camera. This may be because the object is also rotating.
Since I have multiple objects on the scene, I need the objects to move towards the camera.
I figured out how to get it working. Say I want object to travel towards the point (0, 0, 25) in world coordinates. object.translateOnAxis(object.worldToLocal(new THREE.Vector3(0,0,25)),50); will make the object travel 50 units towards the point (0, 0, 25) from its current location.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With