My character is a rigidbody, all movement code is done with AddForce, in FixedUpdate
There is a background that does not move behind character
The camera follows the character, the camera updates in LateUpdate
Now using this basic setup, I cannot find a single way to have all my objects not move with some jitter side effects.
I can add some rigidbody.interpolate ( http://unity3d.com/support/documentation/ScriptReference/Rigidbody-interpolation.html ) but the background is still jittery… I tried using many different smoothing methods for the camera, curently using a double damping, but it doesn’t help. I tried moving around the camera update code, and it didn’t help either. I also tried to fix my FPS to 60 (on PC it can run at 500FPS), and set my physics to 60fps as well, but still they are some jitters.
What is the best practice to have a smooth camera movement with no jitters when your character is controlled by physics ?
Set interpolation of your RigidBody to “interpolate”. It interpolates transforms for the missing frames if your FPS is greater than the update rate of physics.
For me the solution have been to set the Fixed Timestep to 1/FPS, for example if your desired frame rate is 60 FPS then your fixed timestep should be 1/60=0.0166665 or smaller, if you are worried by the performance then you should cap your FPS to 30 or 24 FPS.
add a rigidbody component to your camera and move all your follow code into fixed update. Also make sure that other rigidbody codes are in fixed update. Hope this helps :o)