Need help with setting correct camera rotation behavior (follow charactor)

I made a playground in which I utilised an avatar to navigate [w,s,a,d]. I also designed an ArcRotate camera.
I want the camera position to be placed behind the avatar whenever I move it in any direction.
The problem is pointing in a specific direction. The camera’s alpha is shifting in the wrong way. indicates the camera rotates around the avatar before setting behind the avatar instead than going right behind the avatar.

This is the playground (please use WebGL ver: 4.2.1):

I have use this function to rotate the camera while navigation



See also

Thank you for your support, but I want to use ArcRotateCamera because it has a check-collision method. And with the ArcFollowCamera i’m unable to rotate camera with mouse.

That’s usually caused by using euler angles instead of quaternions. Since you can’t set the ArcRotateCamera’s rotation directly, I would recommend working with the Free/UniversalCamera instead and working with rotationQuaternions.

Sorry im not getting you. :face_with_diagonal_mouth: :worried:
It would be good if you can share any playground (with rotationQuaternions).

Here’s an example of updating a camera’s rotation quaternion: ? | Babylon.js Playground (