Rigidbody movement with jitter

Hello!

I’m experiencing a problem with rigidbody physics or camera following script.
When I rotate the sphere around, everything is ok and there are no jitters; but the problem is when I try to move the sphere as you can see in the following gif.

6522347--735974--movement issue.gif

I simply move the sphere in FixedUpdate with rbody.AddForce and ForceMode.VelocityChange.

This is the CameraFollow.cs script that I’m using: CameraFollow.cs - Pastebin.com

And these are the rigidbody settings:

As you can see I’m using interpolation on the rigidbody.

What I’m doing wrong?
I’m using Unity 2020.1.9f1.
Thanks in advance…

Thanks to the user dlich#9427 through the Unity Discord channel I simply solved by disabling interpolation on the rigidbody.

He says that the important thing is to keep synced the camera position/rotation update cycle with the moving body update cycle. And he say this:

" Updating during regular update, might provide smoother movement, but it’s such a subtle difference that it’s barely noticeable to human eye. It might get bigger if your framerate is high though, because the parity between fixed and regular updates becomes more apparent.
So, I’d rather move your camera code into update and keep the interpolation on."

So a better solution was moving the camera follow to the Update cycle, keep the physics on the FixedUpdate and enabling interpolation.

In this manner I have a smooth movement in term of positions, but when I rotate the sphere the jittering occur again.

So the final solution, thanks again to dlich#9427 was moving also the rotation logic (that was in the FixedUpdate loop) to the Update loop!

Now everythings works like a charm! :smile:

Amazing!!! After hours of messing around and googling and re-writing my movement code and all kinds of other stuff… this finally fixed it. I always thought camera stuff should be in late update, but man this worked soooo good. Thanks!

Thanks! Turning of interpolation did the trick. :slight_smile:

My man saved me a lot of freaking time!!! Thank you!

So if a rigidbody is actively followed by a camera it’s better to have interpolation on it.
Thank you for the explanation!

That is making my player super-fast. HELP! :frowning: