08 / Movement
Easing
named curves for timed moves
Ease-out starts fast and glides in; ease-in-out builds up and brakes; back runs slightly past the end and settles. These are the curves to name when a move lasts a set time between two fixed points, such as a menu panel or a door. For something that keeps chasing a moving target, like a camera, reach for smoothing instead. Pick a curve and play the move; switch easing off to see the same panel at constant speed.
- Menus, panels and buttons
- Doors, lifts and scripted camera moves
- Pickups flying to the HUD
Prompts to paste
UI and scripted moves look robotic because they're linear. Write a reusable tween that takes a duration and an easing curve, defaulting to ease-out cubic for things arriving (about a quarter of a second in menus). Also offer ease-in-out cubic for moves between two resting points, and ease-out back for a playful bounce past the end.
Add a small tween helper and use it for UI and scripted motion. It takes from, to, duration and an easing function, and each frame returns lerp(from, to, ease(clamp(elapsed / duration, 0, 1))). Include easeOutCubic, easeInOutCubic and easeOutBack. Use easeOutCubic over about 0.25 s for panels and pickups arriving, easeInOutCubic for moves between two rest positions, and easeOutBack for playful pop-ins. If a tween is interrupted, start the new one from the current value rather than the old starting point.
Examples
Arrivals: ease out
Quick at first and gentle at the end, so things entering the screen feel responsive and land softly.
Rest to rest: ease in-out
A door or lift that starts and stops at rest should speed up and slow down.
Playful: back
A small overshoot gives icons and pop-ups some bounce. Save it for light-hearted moments.
Pitfalls
Tweening physics bodies
A tween that sets a physics body's position fights the simulation. Use forces or acceleration for those.
Snapping back on interrupt
Restarting an interrupted tween from its original start makes the object jump. Begin from where it is now.
Slow menus
Interface eases much longer than 0.4 s make every screen feel sluggish, however nice the curve.
Starting values
| Setting | Value | Note |
|---|---|---|
| UI moves | 0.15–0.3 s | |
| Camera pans | 0.4–0.8 s | |
| Overshoot | about 10% with ease-out back |