Springs and curves
Learning paths through this topic
Spring motion
Makes a value chase its target as if it hung on a spring, fast at first, then slowing, with an optional wobble. You can change the target at any moment and it reacts naturally, and a slow frame never breaks it.
Bezier curves
Smooth curves you shape with a few handle points, for flight paths, roads, swooping cameras and your own movement curves. Things can travel along them at a steady speed, which plain use of a curve does not give you.
Smooth paths
A smooth curve that passes through every point you give it, walked at a steady speed. Lay out a route with a few points and get a line with no corners.
Aim an arrow or bolt ahead of a running enemy so it actually hits
Shooting at where an enemy is means missing where it will be. Working out where to aim is a small puzzle with a few traps: enemies running away faster than the arrow, the same speed, or straight at you. Here is how to get a point to aim at, or to know there is none.
Keep a half-mined block's cracks for a moment when the player pauses, then let them heal
If every pause of the pickaxe wipes the cracks, mining a hard stone becomes a chore, and if cracks stay forever the world fills with half-broken blocks. Here is a rule that forgives a short pause, heals slowly after it, and tracks several blocks at once.
Dip the camera when the hero lands from a long fall, but not from a small hop
A landing that shakes the view makes a fall feel heavy, but if every step off a stair does it the game becomes seasick, and measuring the wrong thing makes a short drop feel like a cliff. Here is what to measure and how to let the view recover.
Stop the view from jerking up each time the player climbs a step or ledge
Walking up stairs, rubble or a log in a survival world makes the camera jump a full step in one frame, which feels like hiccups. Here is how to keep the body exact but let the view catch up smoothly, including on long stairs and on the way down.
Let the camera look ahead of the hero without swinging on every small tap
Showing more of the road in the direction you walk helps exploration, but a camera that swings the instant direction changes makes players seasick when they nudge back and forth at a doorway. Here is how to make it calm and still readable.
Pan the camera to a new spot in a fixed time, even when the goal changes midway
Story scenes want a pan that takes exactly as long as the line of dialogue, yet the player can trigger something new halfway. Restarting from standstill makes a visible hitch. Here is how to redirect a move so it carries its speed into the new one.
Move the camera closer when walking into a hut, without flickering at the doorway
A camera that backs off in the open and moves in under a roof is a great idea until the player stands in the doorway and it jitters in and out. Here is how to decide when it counts as inside, so that the move is smooth and never rapid-fire.
Keep the camera from clipping through walls, then let it ease back out
A camera behind the player that is pushed in by walls and trees can show the inside of the wall for a moment, or it can jump out and in again when scraping a corner. Here is an in-and-out rule with different speeds for each direction that avoids both problems.
Make a campfire or torch flicker softly, stronger as the fuel runs low
A light that picks a new random brightness every frame buzzes like a broken lamp, and one that follows a plain wave looks mechanical. Here is how to get a lively but gentle flicker that repeats exactly, and how to make it nervous when the fire is about to die.