08 · Movement · 2D and 3D

Delta time

Why your game runs faster on a 144 Hz monitor.

Games update once per frame. If you move a character 3 pixels per frame, it moves twice as fast on a 120 Hz screen as on 60 Hz, and slows down when the game lags. Multiplying every speed by the time the last frame took (delta time) makes movement the same on every machine.

1–4 frame rate 15 / 30 / 60 / 144Space restart raceTap a frame rate, then Restart

Try this: Pick 144 fps and restart: the per-frame runner wins easily. Pick 15 fps: now it crawls. The delta time runner always takes 2 seconds.

per frame (no delta time)speed × delta time

Per frame -Delta time -

Both are tuned to finish in 2 s at 60 fps.

Prompt bit

Works for 2D or 3D in any engine (Unity, Unreal, Godot, web). Paste the short one for a quick fix, or the detailed one when you want it done properly.

Make all movement frame-rate independent: multiply every speed, rotation, timer and force by the frame's delta time in seconds, and clamp delta time to 0.1 s so a hitch or alt-tab can't teleport objects through walls.

36 words · one sentence to paste as is

Where it's used

Common mistakes

Multiplying an already per-second physics velocity by delta time again, using a fixed lerp factor for smoothing, not clamping delta time after a hitch (objects tunnel through walls), and multiplying instant impulses like jump velocity by delta time.

Writing this with an AI assistant? See our best AI coding assistants for game developers.

Missing a concept? Request one.

Related concepts

New concepts, in your inbox.

One short email when we add new concepts, plus our weekly roundup of AI tools for game devs. Unsubscribe any time.