ArcRotateCamera setting lockedTarget once vs. setting target every frame in scene.registerBeforeRender()

You need to:

  • set the camera target after you compute the new player position, as it depends on it
  • explicitely update the world matrix of the player / target mesh before getting the target mesh position. The world matrix computation is normally done by the system, but later in the process.

https://www.babylonjs-playground.com/#3EDS3A#78

4 Likes