going back to 2.6.2 - stutter on following player rigidbody object

Hi,

What would be a great way to go back to 2.6.2?
It seems like I never had this stutter with camera until I update to 2.6.3.
I’ve tried every combination of Update Method + Blend Update Method but no luck.

It’s hard to know why you have the stutter without a little more info. You can always revert to 2.6.2 if you want, but it might be better to get to the bottom of this issue.

Can you make a small project that reproduces this problem?

edited:
I just tested out by comparing the player movement in Scene View vs Game View (with cinematic camera). the player movement itself does not have any stutter.
I am just setting
rigidBody.velocity = _currVelocity; in FixedUpdate()
Input is processed in Update() and it sets a _desiredVelocity then it is used in FixedUpdate() to calculated modified velocity such as getting projected velocity on the ground with its normal but these are just velocity modification which comes down to _currVelocity at the end and if I see the player movement from Scene View, it looks exactly what I implemented. So the problem is in the Game View with cinemachine. It makes the same issue with SmartUpdate/Late Update.

(btw, it had same problem with 2.6.2 - I just didn’t noticed it because it was not that noticeable somehow but once I notice it, its there!)

edited 2:
it seems like its definitely something to do with the following the rigidbody object. I believe I am just missing a simple checkbox or something.

and here is the cinemachine camera properties




edit3:

removing the horizontal damping to 0 makes it smooth actually but I miss the little lazy following

edit4:

I can probably make a simple lazy following to the player which will be used as follow target for the cinemachine camera but let me know if you have better idea/solution for it!

edit5:

with damping horizontal value 0, it follows the player smoothly but all the background(further objects) are stuttering now

edit 6:

making the fxied timestep to be 0.0133333 rather than 0.02
and manually updating the brain in Update() seems to make the whole thing much smoother but Im a bit concerned about changing the fixed timestep…

So, your symptoms are: with nonzero damping, the character is jittery, and with 0 damping the character is steady but the background is jittery. That points to the character not being animated smoothly. There is no way to fix this in the camera, you have to animate the character smoothly.

The main thing to understand is that in Unity there are 2 clocks: the physics clock, and the render clock. The physics clock operates at a constant deltaTime, while the render clock timestep can vary, depending on the environment. If you are calculating velocities based on variable deltaTime (in Update) and then using them in FixedUpdate which expects a constant deltaTime, then you can get jitter.

Try doing 100% of the motion calculations for the character in FixedUpdate.

the character itself is smooth - I checked it both on SceneView and GameView with a static camera.

I am setting a certain velocity in Update and FixedUpdate does all the rest to modify it before fetching it into Rigidbody.velocity. I will try moving all the velocity stuff entirely in FixedUpdate and only execute “input” in Update.

Hope this works…!

1 Like

Checking in the scene view is of limited value, because subtle jitter won’t always be easily discernible there. A good test is to attach a simple camera as a child of the character, and then move the character around. If the character is not moving smoothly, you will see jitter in the background.

oh wait, I just restarted unity to just make sure but the jitter is still there. I wonder its related to the update order…? since it works sometime and don’t?

Just tested attaching the camera to the player and saw it in the Game View. background/character both are smooth as normal.

If everything is smooth with an attached camera then you have proved that the character is now animating smoothly. Now we can look at the CM camera.

Since you are now animating everything in FixedUpdate, then the camera must also be animated in FixedUpdate, or you may get jitter. What is the update setting in the Brain? It needs to be FixedUpdate or SmartUpdate.

I think I see where the core problem is coming from- I was Quaternion.Slerp ing rotation of the follow object. Either I do it in FixedUpdate() or Update(), it makes the jitter. If I turn off the rotation of the follow object it seems smooth…

To be more exact, camera and rigidbody objects are fine. its just that rotating a moving rigidbody is creating the stutter.

edit2: after making the rotation separate for the visual player component only makes it all smooth. I had a different player controller implementation before which worked fine with the rotation since it was not moving via rigidbody.velocity - thanks for the help!