23 · Camera · 2D and 3D

Camera deadzone

Let the player move a little before the camera follows.

A camera that follows every tiny step makes the whole screen twitch, especially when the player taps back and forth. A deadzone is a box in the middle of the screen where the player can move freely. The camera only moves when they push against its edges. The view stays calm and readable.

←→ moveZ deadzone on/offHold ◀ ▶ to move

Try this: Tap left and right quickly with the deadzone off: the whole world shakes. Turn it on (Z) and do the same.

deadzone

Camera moved 0 px

Wiggle left and right.

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.

Add a camera deadzone: keep a box around the screen centre about a quarter of the screen wide, move the camera only by how far the player is outside it, damp that move over about 0.15 s, and snap onto the player after respawns.

44 words · one sentence to paste as is

Where it's used

Common mistakes

A deadzone so wide the player reaches the screen edge before the camera moves, moving the camera to centre the player instead of to the box edge (it snaps), jumps that bounce the camera vertically, and no damping so the edge push feels like a jolt.

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.