04 · Movement · 2D and 3D

Variable jump height

Tap for a hop, hold for a full jump.

With one fixed jump, players can't make small hops, so precise platforming feels clumsy. Letting go of jump early should cut the jump short. This one rule is why Mario feels controllable. Most games also fall faster than they rise, which makes jumps snappy instead of floaty.

Space or ↑ tap or hold to jump←→ moveV variable on/offTap or hold  Jump 

Try this: Tap jump quickly, then hold it. Compare the arcs. Switch it off with V and every jump is the same.

last jump arcscoin heights to hit

Coins 0 / 3

Grab the low coin with a tap, the high one with a hold.

Prompt bit

Works for 2D or 3D in any engine (Unity, Unreal, Godot, web). Paste the short one for a quick fix, or the detailed one when you want it done properly.

Make jump height depend on how long jump is held: if jump is released while still rising, multiply upward velocity by 0.45, so a tap lasts about 0.2 s and a full hold 0.4 s, and ignore releases after the peak.

41 words · one sentence to paste as is

Where it's used

Common mistakes

Setting velocity to zero on release (an ugly hard stop), cutting again every frame the button is up, letting the cut apply to spring or knockback launches, and guessing gravity by hand instead of deriving it from height and time.

Writing this with an AI assistant? See our best AI coding assistants for game developers.

Missing a concept? Request one.

Related concepts

New concepts, in your inbox.

One short email when we add new concepts, plus our weekly roundup of AI tools for game devs. Unsubscribe any time.