Cameras, worlds and scrolling
Making a level bigger than the screen, and deciding what the player sees.
6 min readThe world is not the screen
A scene has two sizes. The canvas is how big the game is on screen, set once for the whole project under Settings. The world is how big the level is, set per scene — and it can be far larger. A world of 4000×720 with a 1280×720 canvas is a side-scroller three screens wide.
Following the player
Set the scene's camera follow to an entity and the view tracks it. Two settings shape how that feels:
| Setting | Effect |
|---|---|
| lerp | How quickly the camera catches up. 1 is rigid; 0.08–0.12 feels natural; below 0.05 is dreamlike and hard to aim with. |
| deadzone | A box in the middle the player can move within before the camera moves at all. Stops small hops from rocking the whole screen. |
The camera is clamped to the world bounds, so it never shows the void past the edge of your level.
When not to follow
Single-screen games — Breakout, Match Three, Tower Defence — set follow to nothing and size the world to the canvas. The 2.5D kits also use no follow: they draw their view in screen space, so a scrolling camera would slide the whole picture away.
Parallax
Each layer has a parallax factor. At 1 it scrolls with the world; at 0 it is pinned to the screen; at 0.3 it drifts slowly behind everything, which is what gives distance to a backdrop. Stack two or three background layers at different factors and a flat sky becomes depth.
A HUD is simply a layer at parallax 0 — that is why score text stays put while the level scrolls underneath it.
Shake and flash
The Camera Shake and Camera Flash nodes are the cheapest way to make a hit feel like a hit. Keep them short — 150–200ms — and small. A long shake reads as a bug rather than an impact.