I’m making a game with a speed-centric, physics-based movement system, and I’m using a Freelook camera. However, whenever my player character moves–especially at high speeds–the camera jitters. It almost looks like it lags behind for a few frames before catching up; I’ve already tried changing the orbital transposer dampening, but that didn’t work. Can someone explain the issue and how I might solve it?
play around with different targets like having an empty game object as a child of the player object may work better. This issue has something to do with how the physics update and when the camera tracks.
sometimes using the root object or even a bone is not ideal.
Another option is in the composer and rotation composer settings add dampening to smooth out the focusing
How is the character being moved? Ideally you should enable Interpolation on the Rigidbody and move the character using ONLY the appropriate Rigidbody API, from FixedUpdate.
If you do that correctly, then CM will track the character properly in LateUpdate and there should be no jitter. If you do that incorrectly, then there will be no jitter-free way to track the character.
Switching from Update to FixedUpdate and using Interpolation fixed the issue (I use the .velocity of a rigidbody), but it created a few rotation oddities (the character now has a weird wobble when traversing curved terrain) and broke my GetButtonDowns and GetButtonUps, so I’ll have to find a way to fix all of that.
That said, I have one more question, if you will humor me. When I look up tutorials and videos of other people using freelook cameras, they don’t use FixedUpdate(), yet they don’t have camera jittering issues. Why might that be? Is it because my player character’s speed is particularly fast? I wouldn’t think that’s why, since the jittering happens even at speeds as low as ~8 meters (Unity units) per second, but maybe it is?
Probably it’s because they don’t use Rigidbody on their character. Adding a physics simulator brings a whole host of issues that need to be handled with care to avoid aliasing between FixedUpdate and Update frames.