Camera.radius changes with camera.position

I am trying to move my camera with SetPosition. Unfortunately camera.radius also gets affected. I was aware that camera.radius has zooming values so why does it get affected when I use SetPosition?

scene.registerBeforeRender(function ()
            {
             console.log(camera.radius);
             forwardDirection -= 0.01;
             camera.setPosition(new BABYLON.Vector3(0, 0, camera.position.z*forwardDirection)); 
            }

The radius is used by the arc rotate camera to compute the position: if you change the position “by hand”, radius have to change too.

Maybe you don’t want to use an arc rotate camera but a universal one instead?

1 Like

Thanks for this. I did not know that arcCamera’s attributes are dependent.

1 Like