- Home /
How to smoothly rotate the camera to the rotation of the player?
Hello, I was trying to make the camera's rotation match that of the player's rotation smoothly at some point in the game, but after trying out things like Quaternion.RotateTowards
or Quaternion.Slerp
on the camera script the camera just snaps mid-way and starts jittering on the spot. Here's my attempt:
//here it is
Vector3 newPos = new Vector3(target.position.x, target.position.y, target.position.z - 1);
transform.position = newPos;
transform.rotation =
Quaternion.RotateTowards(transform.rotation, Quaternion.Euler(0, 0, 46), 100f * Time.deltaTime);
How do I make the rotation of the camera match the rotation of the player without jittering and weirdness? Thanks in advance!
Comment