Character is jittering stuttering shaking
This is likely due to physics causing penetrating bodies to be pushed too far away from the collider they are intersecting. This could be because character movement is being done in Update()
which executes quickly, but physics is done in a fixed time step loop.
For example, in Update()
the character is made to walk forward 1 unit. The physics engine calculates that this puts the character through the wall and needs to be pushed back. However because the physics loop is slower, it pushes the character back further in the world to adjust for the extra time length, and therefore appears to jitter. This can also be the case for objects affected by gravity, like a character just standing on a floor with a collider.
Possible solutions:
- For any character movement, try replacing any
Update()
calls toFixedUpdate()
- Another solution consists of making the camera the child of the character. (You may need to move any rotation code to a new script and attach that to a child of the camera to avoid rotating the camera along with the character, unless you intend to adopt this behaviour).