Cinemachine/Rigidbody rotation jitter

Hello,

I’m working on a third person character controller using a Rigidbody and I’m using Cinemachine to help with that. However, I’m running into an issue with jitter in two areas. I can solve them individually but I can’t seem to come up with a solution to solve both at the same time.

I have a Framing Transposer along with a POV component. I also have the character rotating to face the camera forward.

Now for the two places’ the jitters are appearing. One is when the character is rotating to face the camera forward, the character rotation is jittery, but the world around will be smooth. The other is the exact opposite, everything around the character will be jittery but the character rotation will be smooth.

The difference seems to be in how I apply the rotation. When I use Rigidbody.MoveRotation() the character rotation becomes jittery, when I set the rotation via transform.rotation the character rotation will be smooth.

Cinemachine is being manually updated in LateUpdate while the rotation is being set after my LateUpdate scripts are run in ‘FinalUpdate’.

For context, the scripts are run like so:

private void LateUpdate()
{
     // run LateUpdate scripts

     // run FinalUpdate scripts
}

I’m going a little stir crazy trying to figure this out. Please let me know if you have any advice for me.

Heyyoo,

Is your rigid body interpolate field set to interpolate?
Here is the explanation what causes the jitter.

1 Like

It is indeed! I’m just not sure why the jitter is happening with rigidbody.MoveRotation. I can kinda see why the jitter may happen when directly setting the transform on a rigidbody, but you’d think setting with MoveRotation wouldn’t have that issue.

Perhaps POV and FTransposer just don’t play well together. I managed to get results I’m mostly happy with using the 3rd Person Follow component.

Also, just now I managed to find a full work around and I’m a little embarrassed I didn’t think of it sooner. Rather than rotating the Rigidbody itself I just rotated the visual mesh that’s a child of the rigidbody.

1 Like