Jittery object motion

When the camera is still, all moving objects look like they move smoothly, but when the player (and thus the camera) move, they all appear to have an extreme jitter in their movement. This is using cinemachine to follow the player.

From what I’ve read, this is due to the fact that the player itself is jittering, causing the camera to do so as well. So my question is why is my player jittering? It has a rigidbody with interpolation on, all physics are done in Fixed Update, player movement is done by setting it’s velocity which is smoothdamped, Camera is updated with Smart Update (Late Update and Fixed Updated had worse results). Idk what else I could do??

Interestingly, this wasn’t always a problem in my game, so I don’t know why it all of a sudden is? I haven’t made any changes to player movement or camera or anything.

Is this game 3D or 2D, does it use materials for the objects, what is the ground made of, can you just give more information please? It is a little hard to help when there is not very much info available about the problem. How is your script doing the movement?

1 Answer

1

Before you read on, my answer is not a definite answer. I am only suggesting things that might work.

  1. Don’t set the velocity of the player rigidbody, no matter how smoothly you apply the velocity. That’s just a bad idea to do every frame. Instead, make use of the rigidbody’s physics and apply force to move it.

  2. Instead of using cinemachine, try creating your own camera implementation, like this for example:

        //Looking around
        float mouseX = Input.GetAxis("Mouse X") * mouseSensitivity * Time.deltaTime;
        float mouseY = Input.GetAxis("Mouse Y") * mouseSensitivity * Time.deltaTime;
    
        xRotation -= mouseY;
        xRotation = Mathf.Clamp(xRotation, -90, 90);
    
    
        cam.transform.localRotation = Quaternion.Euler(xRotation, 0f, 0f);   //Needs a gameObject cam which is your player's camera, which should be parented to the player
        gameObject.transform.Rotate(Vector3.up * mouseX);   //This script should be attatched to the player