Spielerando

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.

Also called: Dead zone, Deadzone camera, Camera window.

A felt owl-knight stands near the right edge of a large dotted-stitch rectangle in the middle of the scene, swinging a toy sword at a stitched beetle while the cloth hills behind just begin to slide.
Thimblewick Skirmish, an invented cloth-craft action game. Invented game, image generated with AI.

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.

leaves the boxback in the boxreaches the screen edgeeases off the edgejumps far awayjumps back insideAt restFollowingHeld at edge
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

ValueStart withWhat it changes
deadHalfX2 unitsHalf the width of the box. About an eighth of the screen width leaves room to move without the camera nagging. Zero follows every step.
deadHalfY1.2 unitsHalf the height of the box. Smaller than the width, so small jumps do not bounce the screen up and down.
hardHalfX7 unitsHow 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.
hardHalfY5 unitsThe same up and down. It must stay larger than the box.
catchUp6 1/sHow 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

Works well with

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.

Where this mechanic comes from has not been researched yet.

Games are named only as references. Names and marks belong to their owners, and nothing here is endorsed by them.

What was checked

This is what separates the blueprint from a catalogue entry: the values on this page come from code that runs.

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