I come from Unity background and if we want to move/rotate an object slowly to a certain position/rotation, we use Time.deltaTime in Update function. Is there a similar approach in Babylon? Such that by press of a key (Key.A), the camera moves/rotates slowly to a given position/rotation? The Vector3 will be set by me through code.
var scene = new BABYLON.Scene(engine);
// This creates and positions a free camera (non-mesh)
var camera = new BABYLON.ArcRotateCamera("Camera", Math.PI / 2, Math.PI / 2, 300, BABYLON.Vector3.Zero(), scene);
// This targets the camera to scene origin
camera.setTarget(BABYLON.Vector3.Zero());
// This attaches the camera to the canvas
camera.attachControl(canvas, true);
You can find an example of a very basic camera’s target animation in my neon demo, at line 274 of the PG, I use CreateAndStartAnimation on the ‘target’ property of the camera:
Another way to do the same is to update the rotation/position in the render loop but I think using animation is the easiest way to do it.