TL;DR: for following a rigidbody with a smooth camera that moves on Update and reducing the jittering effect:
- Setting extrapolate on the rigidbody improves a lot
- Smoothing camera movement with Vector3.SmoothDamp improves over Vector3.Lerp
- Using an average position of the character improves if using Vector3.Lerp
- None of these solutions are completely perfect (I always experience a bit of jitter)
Hey, sorry for the long time no-posting and thanks for your interest! I tried your suggestions and almost succeeded using extrapolate (this is the one that improves the most) + smoothdamp. However, despite the result being very convincing, there is still a bit of jittery effect.
My first approach was to rely on a camera moving on FixedUpdate as I read on other discussions that this is the way to go. I would preferably continue doing this and thus am still looking for an answer to “how to synchronize VFX Graph with a FixedUpdate camera?” (see original post).
Cinemachine
Disclaimer: I have never used Cinemachine before and therefore I may have configured it wrong. I tried a follow camera as described here in the documentation.
Cinemachine synchronizes well with the target moved on FixedUpdate with AddForce (left GIF). However, the VFX is jittery in this case. Using extrapolate on the rigidbody inverses the effect (GIF on the right).
Note: I am reluctant to using Cinemachine as I would expect that there would be a simple solution to such a common setting (target moved on FixedUpdate + Camera following it + VFX around).
Left: cinemachine
Right: cinemachine + extrapolate
SmoothDamp
Smoothdamp on its own does not solve the problem. It was to be expected as it is basically like a Lerp but with a damping effect (left GIF). However, using smoothdamp with extrapolate on the followed rigidbody almost solves the problem (right GIF). The jittery effect is still there but almost imperceptible (I hope you can see it on such a low res GIF: focus on the edge of the cube).
I do not understand why does extrapolate helps reducing the jittery effect. By reading the doc I would have expect it to only be used in resolving collisions, not affecting movement / rendering itself.
Left: Smoothdamp
Right: Smoothdamp + extrapolate
Moving average target position
Following a moving average position of the target’s position does not solve the problem (left GIF). I think it was to be expected as this just averages the position but does not fix the fact that the smoothed camera movement (Update) does not happen at the same rate as the target (FixedUpdate). However it improves, and it improves further using extrapolate (right GIF). Similarly, as SmoothDamp, a bit of jitter is still visible though.
Same as before, I do not understand why does extrapolate helps.
Left: Moving average
Right: Moving average + extrapolate