three.js - how to make camera look at an object during a tween

Sadly, as of three.js version 112 in Feb 2020, camera.target no longer works. jb


The renderer calls THREE.Camera.update(), which sets the rotation of the camera by default to look at THREE.Camera.target (which is an THREE.Object3D). Instead of doing...

camera.lookAt( camTarget );

...try...

camera.target.position.copy( camTarget );

I'm not sure I follow how camTarget is tweened, or maybe it just should switch to the new object?

Side note: it's advisable not to perform heavy computation in event handlers - in the best of worlds, you set a flag in the event handler and process in the render loop.