I am trying to update my camera position using the Tween library. I’ve added it to several objects in my world, and they are all working as expected. With the camera however, it only appears to adjust the ‘z’ value of my camera position. It does however jump to the correct coordinates, it just then immediately jumps to a (0, 0, ‘z-value’). I’ve checked a couple of solutions on SO. But none of them seem to resolve my issue. Any advise welcome.
Thank you for the inspection. I had a look at the fiddle, I see some values were changed, but overall the same idea. I found two differences in our codes.
You included the function TWEEN.removeAll() - Please elaborate why you did this?
I noticed that I didn’t include my render function in my description, and inside of that I have the function camera.LookAt( scene.position ). The moment I turned that off, the Tween worked perfectly. Is this a conflict with Three.Camera and Tween perhaps?
To remove existing tweens in order to avoid conflicting animations.
Calling Object3D.lookAt() does only change the orientation of an object, not its position. So as long as you do not animate the orientation of the camera, there should be no conflict.
It would appear that the hovering effect that I have set up with the camera is causing the issue. not the camera.LookAt() function. Is this what you were referring to in your reply?