A follow camera that does not stutter
How do I make the camera follow the player without jitter?
Move the camera in LateUpdate, never Update: LateUpdate runs after everything else has moved, so the camera reads a position that is already final. If the player uses a Rigidbody, also set the Rigidbody's Interpolate option to Interpolate — physics ticks at a different rate from your frames.
A follow camera is four lines of code and one decision about where to put them. Put them in Update and the camera reads a position the player has not finished moving to yet, and every frame is a frame behind — which your eye reads as vibration.
Unity runs every Update, then every LateUpdate. Move the camera in the first half and it reads a position the player only reaches next frame.
LateUpdate, always
Unity runs every Update in the scene, then runs every LateUpdate. Anything that has to react to where things ended up this frame belongs in LateUpdate, and a follow camera is the textbook case.
using UnityEngine;
public class FollowCamera : MonoBehaviour
{
public Transform target;
public Vector3 offset = new Vector3(0f, 6f, -8f);
[Range(1f, 30f)]
public float smooth = 10f;
void LateUpdate()
{
if (target == null) return;
Vector3 wanted = target.position + offset;
// Frame-rate independent smoothing. A plain Lerp with a constant t
// moves further per second at higher frame rates.
transform.position = Vector3.Lerp(
transform.position, wanted, 1f - Mathf.Exp(-smooth * Time.deltaTime));
transform.LookAt(target.position + Vector3.up * 1.5f);
}
}If the player uses a Rigidbody
LateUpdate alone is not enough here. Physics steps 50 times a second while the screen draws 60, 90 or 120 times, so on most frames the player has not moved since the last physics tick and the camera has. That mismatch is the jitter.
Set the player's Rigidbody Interpolate to Interpolate. Unity then draws it between physics ticks instead of snapping, and the camera has something smooth to follow.
Set it on the player only, not on every Rigidbody in the scene — interpolation costs memory per body and nobody is watching the crates.
Never move a Rigidbody with transform.position while a camera follows it. That skips interpolation entirely and puts the jitter straight back.
Still not smooth?
Check that nothing else writes to the camera's position. Two scripts fighting over one transform looks exactly like jitter.
Check the frame rate in the Game view's Stats panel first. Judder at a locked 30 FPS is not a camera bug.
If the camera is a child of the player, delete the script — a child already follows. The script and the parenting then fight each other.
the lesson that builds this
Follow camera
This post is a standalone recipe. In the course, the same thing is built as part of the one project that runs through all five tabs — Camera & Input, lesson 01.