Camera
Learning paths through this topic
Drag to look around a room: the glide after letting go starts wrong or never ends
Dragging a finger or mouse to look around is natural on phones and for slow, careful games, and a little glide after letting go makes it feel real. But pausing before release should not fling the view, and the glide should end for good. Here is how to measure the speed and stop it.
The fixed camera flickers between two views when the player stands on the border
A corridor with a hand-placed camera for each part looks great until someone lingers at the line between two parts and the view flips back and forth. Here is how to decide which camera is active so that it settles.
The camera follows smoothly on my screen but lags or jerks on another
A camera that glides after the player at one frame rate trails far behind at another, because the usual smoothing step depends on how often the picture is drawn. A different way of calculating it gives the same movement everywhere. Here is the calculation and a stopping rule.
Turn the player's view towards the monster without a spin or a snap
Sometimes the story must make the player look at something, and the turn must feel like fright, not like a glitch. Here is how to turn the short way round, how fast to go, and when to hand control back.
In a chase the camera should show what is coming, but never lose the player
Seeing the pursuer creep into the edge of the picture is what makes a chase frightening. Pulling the view towards it too hard pushes the player off the screen. Here is a way to weight the view towards the threat that fades smoothly and keeps the player safe in the frame.
Keep two or more players on screen by zooming out as they separate
In a shared-screen game, one player runs off and the other leaves the picture. A camera that frames everyone needs a centre, a zoom and a limit past which it stops zooming. Here is how to calculate them, make the zoom feel even and tell players when they have reached the limit.
Nudge the view towards a clue, but only when the player is not turning
Some story games want to help the player notice the important thing without grabbing the camera. A slight drift can do it, but it fights the player if it starts at the wrong time. Here is the rule for when it acts and how strong it is.
Walking in first person bobs the view in a way that makes some players feel sick
A little sway makes footsteps feel real, but done carelessly it keeps going in the air, jerks when you stop, or runs out of step with the feet. Here is what should drive the sway, what should drive its size, and how it comes to rest.
A flashlight or lantern that follows the view rigidly feels stuck to the screen
A held light that moves exactly with the camera looks fake, and one that lags can fly off or shiver on a slow computer. Here is a springy follow that gives the light a little weight, stays steady at any speed, and never leaves the screen.
Examining a found item up close: it is cut off, clipped away, or tiny on a phone
Picking up a note or a key to turn it around is a classic. It goes wrong when the thing is bigger than the screen at the start, disappears when you zoom in too far, or fits a wide window but not a tall one. Here is how to set the view limits from the object itself.
The character turns back the moment the camera angle changes while I hold the stick
In games with fixed camera angles, walking across a boundary swaps the view, and the stick suddenly means a different direction. The character does a U-turn or runs in circles. Here is the rule that keeps movement steady and when to let go of it.
Peeking around a corner pushes the view through the wall
Peeking out from cover is great for tension, but a peek that does not know about walls shows the other side of them, or lets the eye pass through a door frame. Here is how to limit it by the room available, and why it must shrink faster than it grows.