09 / Movement
Squash & stretch
bend the shape, keep the volume
Squash and stretch is the cartoon rule that a body keeps its volume while its shape follows the motion: tall and thin at speed, short and wide at the moment of impact. In 3D, when height scales by s, scale width and depth by 1/√s; a 30% stretch makes the capsule about 12% narrower each way. Without that volume rule, the object seems to inflate instead of deform.
- Characters jumping and landing
- Bouncing pickups, slimes and projectiles
Prompts to paste
Landings feel stiff. Deform only the character's visible mesh, from a pivot at its feet: flatten it on touchdown (to about 0.75 of its height, recovering in roughly 0.1 s) and lengthen it while it falls fast (capped near 1.25). For a height scale s, set width and depth to 1/√s so the volume holds; leave the collider alone.
Give the player's visible mesh squash and stretch, leaving the collider untouched, with the pivot at its feet. While it moves fast vertically, set its height scale to 1 + 0.25 × (speed / maxSpeed)², so it peaks at 1.25. On touchdown, drop the height scale to 0.75 and bring it back to 1 over about 100 ms with an ease-out-back curve. Every frame, scale the other two axes by 1 / √(height scale) to keep the volume constant (in 2D, scale the width by 1 / height scale). Make the strengths and timings tunable.
Examples
Anchor at the feet
Scaling around the middle lifts the feet off the floor during a squash. A pivot at the base keeps them planted.
Anticipation before a jump
A quick squash just before take-off and a stretch as the character leaves the ground make the jump look powered.
Clamp the extremes
Capping the stretch keeps very fast falls from turning the character into a needle.
Pitfalls
Deforming the collider
A squashed collider changes what the character touches and can let it slip through thin floors. Scale only what's drawn.
Scaling one axis
Stretching the height without narrowing the other axes makes the object grow and shrink instead of changing shape.
Making everything soft
Crates, walls and armoured foes should stay rigid. The contrast is what sells the soft things.
Starting values
| Setting | Value | Note |
|---|---|---|
| Max stretch | 1.2–1.35× | |
| Landing squash | 0.65–0.8× | |
| Squash time | 60–120 ms, then ease back |