---
title: "Variable jump height: short hops and full jumps, one button"
description: "Variable jump height turns how long you hold jump into how high you go: a tap is a 1.1-tile hop, a hold 3.6 tiles. See the timing and play it."
date: 2026-11-18
url: https://valdemird.com/blog/variable-jump-height/
lang: en
tags: ["game-feel", "game-design", "godot", "platformers"]
---

**Playable sheet: Variable jump height** (the real game, in the page)

- Video: https://valdemird.com/videos/play/platformer-lab/plataformas-variable.mp4 (Short hops under the spiked ceiling and a full jump over the wall. Then T switches the technique off: every jump comes out full and the first one hits the spikes.)
- Play: https://valdemird.com/play/platformer-lab/index.html?plano=plataformas&lamina=variable&lang=en

How to try it:
1. Run right with →. Under the spiked ceiling, tap Space briefly: short hops over the gaps.
2. At the end, hold Space for the full jump over the three-tile wall.
3. Press T to switch variable jump off. Every jump is now full height, and the ceiling is waiting.

# Variable jump height: short hops and full jumps, one button

> Variable jump height turns how long you hold jump into how high you go: a tap is a 1.1-tile hop, a hold 3.6 tiles. See the timing and play it.

With **variable jump height**, the longer you hold jump, the higher you go: a tap gives a 1.1-tile hop and a full hold gives 3.6 tiles. One button then covers both a low ceiling and a tall wall.

**Variable jump height.**
- hold window (380 ms): with the technique, You let go n ms in: gravity triples and the jump comes out shorter. Without it, Letting go does nothing: every jump is the full 3.6 tiles.

Variable jump height: a tap hops, a hold jumps

Obstacles ask for different heights. A spiked ceiling wants a short hop, a wall wants the whole jump. Variable jump height lets the player pick any height between 1.1 and 3.6 tiles with the same button, and the button reads the hold the way players already expect. Without it, every obstacle in the game has to be designed around one arc.

How to implement variable jump height

1. **Watch for the release while rising.** If the button comes up while the character still moves upward, mark the jump as cut.
2. **Raise gravity until the top.** A cut jump rises with gravity ×3, so the arc bends instead of breaking. Halving the upward speed on release also works, but the arc gets a visible kink at that instant.
3. **Cut once per jump.** Pressing again mid-air must not undo it.
4. **Protect wall jumps.** Block the cut for the first 220 ms of a [wall jump](/blog/wall-jump/), or someone mashing the button against a wall loses height on every kick.

**The code in Godot 4.**

`addons/platformer_kit/player/player.gd`:

```gdscript
# SALTO VARIABLE: soltar el botón mientras se sube multiplica la gravedad.
# Toque corto = saltito; mantener = salto completo.
if _jumping and not _jump_cut and velocity.y < 0.0 and not jump_held \
		and _wall_jump_hold <= 0.0 and Lab.on(&"variable_jump"):
	_jump_cut = true
	jump_cut.emit()

var gravity: float
if velocity.y < 0.0:
	gravity = p.gravity_up
	if _jump_cut:
		gravity *= p.jump_cut_gravity_mult
```

`jump_cut_gravity_mult` is 3, and it is the only number to tune.

Quick answers

How short should a short hop be?

About 30% of a full jump: 1.1 tiles against 3.6. Low enough to stay under a three-tile spiked ceiling, long enough (2.5 tiles at a run) to clear a two-tile gap.

Should I cut the velocity or raise the gravity?

Raise the gravity if you want the arc to stay smooth; cut the velocity if you want the release to be visible. Both work.

How long should the hold window be?

Here the hold counts all the way to the top, 0.38 s. [Celeste](https://github.com/NoelFB/Celeste/blob/master/Source/Player/Player.cs) caps it at 0.2 s: while you hold, the upward speed doesn't drop.
