ArcRotateCamera jumps at first frame of animation to Pi alpha


I’m calculating a new target and position for my camera with a given radius. This way I want to keep the same perspective the camera was in beforehand while I can adjust the radius. This works so far, however there is one unexpected thing happening. On start of the animation for like the first frame the camera jumps to an alpha value of Pi. Afterwards it continues the correct animation.

I couldn’t find out what was causing this. Maybe it is a bug? There doesn’t seem to be a link between certain radius/alpha/beta values for it to happen.


let newRadius = 20;

let newTarget = new BABYLON.Vector3(80, 2, 0);

let relativeVector = camera.position.clone().subtract(, newRadius, newRadius);

let newPosition = newTarget.add(relativeVector);

let easingFunction = new BABYLON.SineEase()

BABYLON.Animation.CreateAndStartAnimation("cam pos", camera, "position", 30, 30, camera.position.clone(), newPosition, BABYLON.Animation.ANIMATIONLOOPMODE_CONSTANT, easingFunction);
BABYLON.Animation.CreateAndStartAnimation("cam tar", camera, "target", 30, 30,, newTarget, BABYLON.Animation.ANIMATIONLOOPMODE_CONSTANT, easingFunction);

I found the issue, there was another piece of code that straight up set the cameras alpha value :confused:

camera.alpha = 3.1416

till next time folks…