Hi everyone, I’m working on my custom rigidbody FPS controller and I’ve faced an issue when I rotate the rigidbody during mouse look. You can see it on the video:
I have a Main Camera that is not parented to my Character and is following the Camera Mount object that is the child of my Character.
I get all the input from a keyboard and mouse inside the Update() function,
I move and rotate the character inside the FixedUpdate()
rigidbody.velocity = MoveDirection + (Vector3.up * m_velocity);
float yRot = playerCamera.transform.rotation.eulerAngles.y;
fps_Rigidbody.MoveRotation(Quaternion.Euler(0.0f, yRot, 0.0f));
The camera is moved and rotated inside the LateUpdate()
playerCamera.transform.position = cameraMount.position;
playerCamera.transform.rotation = Quaternion.Euler(x, y, 0);
The camera and the environment are moving smooth, but when I look down, my character is shaking while I’m turning. Is there a way to rotate my character smoothly?