Camera jitter while using RigidBody

I am getting camera jitter because of using RigidBody 3d.
I am use MovePosition() to move the character.
I have switched the cinemachine’s UpdateMethod to LateUpdate and the player’s RigidBody Interpolate method is Interpolate.

1 Like

What is the hierarchy?

I can guess that there is a parenting between camera and character.

In this case, If the camera is moving by non-physics operating artificially (not due to parenting) and the character is moving by physics, then of course you will get issues because you mix up 2 ways of moving.

But you need to provide more context: screenshots, code, video.

Anyway, did this video help you somehow?

1 Like

Yes it was nested.
Screenshot 2024-09-17 at 4.44.06 AM

I tried it by creating the camera and cinemachine camera in the scene itself but it did not solve the issue.

The script is attached to the parent(Player)

1 Like

1 Like

Screenshot 2024-09-17 at 4.47.01 AM

1 Like

MovePosition only interpolates movement of kinematic rigidbodies and so your object won’t be smooth if moving it from within FixedUpdate.

2 Likes

Nice shot! It appears that it is another conflict here.

Hey, I created a new project and followed as you said yet I am facing the same issue.

1 Like

Screenshot 2024-09-17 at 4.33.00 PM

1 Like

It’s because you are using the rigidbody API in Update(). Try doing all of your rigidbody API calls in FixedUpdate() only.

1 Like

Hello,

I just found out that the jitter was caused by the HandleRotation() function. I moved the function to FixedUpdate() , and now it’s working fine. Thanks!