Camera Dead Zone
A dead zone is a box in the middle of the view where the character can move without the camera following. Only a character that leaves the box moves the camera, and only by the part that sticks out. Near the screen edge the camera is held so the character can never leave the view.

Paste this to your AI
Copy it into Claude, Cursor or ChatGPT. It already has good values and the usual mistakes in it.
Add "Camera Dead Zone" to my game.
What it should do: A camera glued to the character shakes with every step and makes small moves feel like earthquakes. A box in the middle lets the character move around calmly, such as fighting, aiming or jumping on the spot, and the world only scrolls when it needs to.
Build it exactly as this state machine. First check that it fits my game, then build it like this:
```mermaid
stateDiagram-v2
[*] --> resting
resting: At rest
following: Following
pinned: Held at edge
resting --> following: leaves the box
following --> resting: back in the box
following --> pinned: reaches the screen edge
pinned --> following: eases off the edge
resting --> pinned: jumps far away
pinned --> resting: jumps back inside
```
Use these starting values:
- deadHalfX: 2 units
- deadHalfY: 1.2 units
- hardHalfX: 7 units
- hardHalfY: 5 units
- catchUp: 6 1/s
Watch out for these common mistakes:
- Moving by the whole gap: Tell your AI: move the camera only by the part of the gap that sticks out of the box.
- A fixed share per frame: Tell your AI: use one minus e to the power of minus the rate times the time step.
- Creeping for ever: Tell your AI: when the rest is smaller than a tiny amount, move all of it and stop.
- A fast character leaves the view: Tell your AI: add a hard edge. If the gap is larger than that, pull the camera in at once.
- A jump to another place: Tell your AI: for a real cut, place the camera on the character on purpose, instead of leaving it to the hard edge.
Do not change anything else in the game. Do not claim anything without proof: model what it takes, and show me what your solution rests on and how I can see that it works. If you cannot show something, say you do not know. When you are done, tell me in plain words how to try it.Or skip this and connect the MCP: your AI then finds all of this by itself.Connect the MCP
What it does
A camera glued to the character shakes with every step and makes small moves feel like earthquakes. A box in the middle lets the character move around calmly, such as fighting, aiming or jumping on the spot, and the world only scrolls when it needs to.
How it runs, as a diagram
Everything it can be in, and what moves it on. Your AI builds from exactly this.
How it runs, as a diagram
- At rest → Following: leaves the box
- Following → At rest: back in the box
- Following → Held at edge: reaches the screen edge
- Held at edge → Following: eases off the edge
- At rest → Held at edge: jumps far away
- Held at edge → At rest: jumps back inside
Good starting values
| Value | Start with | What it changes |
|---|---|---|
| deadHalfX | 2 units | Half the width of the box. About an eighth of the screen width leaves room to move without the camera nagging. Zero follows every step. |
| deadHalfY | 1.2 units | Half the height of the box. Smaller than the width, so small jumps do not bounce the screen up and down. |
| hardHalfX | 7 units | How far from the camera the character can ever get, sideways. Put it a little inside the screen edge so the character is never cut off. |
| hardHalfY | 5 units | The same up and down. It must stay larger than the box. |
| catchUp | 6 1/s | How fast the camera closes the gap once the character is out of the box. Higher feels tight, lower feels floaty. |
What usually goes wrong
Moving by the whole gap
A camera that moves by the full distance to the character when it leaves the box jumps so the character sits in the middle. The dead zone has no effect at all.
Fix: Tell your AI: move the camera only by the part of the gap that sticks out of the box.
A fixed share per frame
Moving a fixed share of the way each frame makes the camera catch up at different speeds at different frame rates.
Fix: Tell your AI: use one minus e to the power of minus the rate times the time step.
Creeping for ever
A camera that always moves a share of the way never quite reaches the edge of the box. It keeps moving by a hair every frame, and the picture shimmers.
Fix: Tell your AI: when the rest is smaller than a tiny amount, move all of it and stop.
A fast character leaves the view
A smooth camera is slower than a fast character, such as a dash or a fall. The character runs off the screen before the camera catches up.
Fix: Tell your AI: add a hard edge. If the gap is larger than that, pull the camera in at once.
A jump to another place
After a respawn or a teleport the character is far away. The hard edge pulls the camera in one frame until the character is at the screen edge, and then it slides the rest, so the picture jumps and then drifts.
Fix: Tell your AI: for a real cut, place the camera on the character on purpose, instead of leaving it to the hard edge.
How to check it works
- The character stays inside the box for two seconds. It moves around there: The camera does not move at all.
- The character stands 5 units from the camera and the box is 2 units wide on each side. One tick passes: The camera moves a share of the 3 units that stick out, not of the full 5, and only in that direction.
- The character stands still 5 units from the camera. Three seconds pass: The camera has stopped exactly 3 units from where it started, with the character on the edge of the box, and it does not move any more.
- The character runs away at 40 units per second. You look at every tick: It is never further from the camera than the hard edge.
- The character appears 50 units away. One tick passes: The camera is exactly the hard edge away from the character, in both directions.
- The box has size zero. The character moves a tiny bit: The camera follows and ends up on the character.
- The character leaves the box only sideways, and then only up. A second passes: Only the camera's sideways position changes the first time and only its height the second time.
Works well with
- Camera Look-Ahead: If the dead zone sees the bare position, it hides the look until the character leaves the box. Add the look to the character's position first, then give the result to the dead zone.
Clashes with Room Camera: A room camera shows one fixed view per room. A box that lets the camera drift inside the room fights the fixed view. Use the dead zone in open levels and the room camera in room-based ones. If you mix them, use the dead zone inside one big room only.
Common questions
what do i tell my ai to add a dead zone to my camera
Paste this: Add a camera dead zone: a box 4 units wide and 2.4 units high in the middle of the view. Inside it the camera does not move. Outside it, move the camera by a share of the part that sticks out, using one minus e to the power of minus 6 times the time step, and never let the character get further than 7 units sideways or 5 up and down.
what is a dead zone in a game camera
A box around the middle of the screen in which the character can move without the camera following. The camera moves only when the character walks out of the box.
how big should a camera dead zone be
Start with about an eighth of the screen width on each side, and make it lower than wide. If the camera feels sleepy, make it smaller. If the screen moves at every step, make it larger.
why does my camera shimmer when the character stands still
The camera probably moves a share of the way and never stops. When what is left is tiny, move all of it and stop.
Where it comes from
We could not find a reliable origin for this one yet.
What was checked
- 13 tests pass on the reference code.
- The state diagram was checked against the code, at the default values and at every listed low and high value.
Your AI gets the code
Tested example code comes through the Spielerando connection, so your AI can use it right away. How to connect it