mechanic

Use when

Platforming needs recovery generosity and readable climb points.

What it is. When a jump falls short but clips an edge, the player snaps into a hang, then pulls up. A recovery layer bolted onto the jump — a second chance the layout never had to promise.

Player fantasy / why it’s fun. The heart-in-throat catch. You mistimed, you should have died, and instead a fingertip finds stone. The rescue is the reward; the mantle just cashes it.


The verb · You reach toward an edge you barely made — and the game finishes the reach for you.

How it feels · Ledge grab is system-grace made physical. It’s not a skill you press so much as a promise the game keeps: if you were close, you’re safe. Celeste and countless 2D platformers lean on it so a whiffed jump reads as “almost” not “dead.” The tuning secret — grab window and snap radius are difficulty dials that never touch the level geometry. Widen them and the same gap forgives more; shrink them and the same gap demands frame-precision. See system-difficulty-and-dda.

Tuning levers

LeverWhat it controlsSane default
Snap radiusHow far below/beside an edge still counts as a grab8–16 px (≈¼ tile)
Grab windowFrames after passing the edge where a late grab still fires3–6 frames
Hang stateStatic hold / drains stamina / auto-mantle after delayplayer-held, no drain
Mantle costTime to pull up (vulnerable/committed during it)8–14 frames
Facing gateGrab only when facing the wall, or any approachfacing-only
Re-grab lockoutCooldown before the same edge grabs again~10 frames
Upward-onlyGrab on descent only, or also mid-risedescent + apex

Tune snap radius and grab window together — they are the whole generosity budget. Publish the grab zone visually (a lip highlight, a hand-reach pose) so the promise is [[pattern-readability|readable]]; a grab the player can’t predict feels like the game grabbing them. Keep the snap deterministic — a fixed radius test, no RNG in the catch — so a repeated approach always resolves the same way; pattern-fairness-and-trust dies the first time an identical jump grabs once and whiffs once.

Slots into

Twist seams

How it wires to Hayao

Grab is a state machine on the player: airborne → hanging → mantling → grounded, with the transition into hanging driven by a deterministic overlap test between a small sensor above the character and any edge collider. Keep the sensor size and window in tuning constants, not baked into art. For the collision/kinematics scaffolding, read the physics sandbox lab (sandboxes/physics-lab) — the grab is just an extra state gated on an edge-overlap query, not a new subsystem. Study the logic/view split in examples/sokoban/ if you’re tempted to entangle the hang pose (cosmetic) with the hang state (hashed): the pose is view, the state is truth. The pull-up animation is [[pattern-juice-choreography|juice]] layered on top — the sim can teleport the body up in one commit while the view eases it.

Fails when…

See also

This module rendersthe repo's markdowndirectly — edit it there, it changes here.