10 / Jumping
Coyote time
a grace period after the ledge
Coyote time keeps “can jump” true for 80 to 150 ms after the feet leave the floor, as long as the character walked off rather than jumped. It exists because people judge an edge by eye, and their press regularly arrives just after the last grounded frame. The bar under the scene shows the time since the feet left the ground; a press inside the shaded window still jumps.
- Platformers and anything with edges to run off
- Running jumps across gaps
Press Jump, or press on the scene, to play. If the scripted runner has already pressed, or a round has just ended, your first press starts a fresh round for you.
Prompts to paste
Players fall when they press jump a moment after leaving a ledge. Fix it with coyote time: for 0.1 s after the character steps off without jumping, still accept a jump press, and mark the grace period spent once that jump starts.
Add a coyote time window to the player controller. Keep timeSinceGrounded, set to 0 on every frame the character stands on ground and increased by dt otherwise. A jump press succeeds if the character is grounded, or if timeSinceGrounded is below a tunable 0.1 s and no jump has started since it last left the ground. When a jump starts, mark the window as spent so a quick second press can't become a double jump. Measure in seconds, not frames, so the window doesn't shrink at high frame rates.
Examples
Pairs with buffering
Coyote time forgives late presses and jump buffering forgives early ones. Together they absorb most timing slips.
Walking off only
The window opens when the character leaves the ground without jumping, never part-way through a jump.
Moving platforms
Measure from the last frame on the platform, so the window still works when a platform carries the character to its edge.
Pitfalls
A free double jump
If starting a jump doesn't close the window, two quick presses give two jumps.
Counting frames
A 6-frame window is 100 ms at 60 fps but only 42 ms at 144 fps. Count time.
A window that's too generous
Past roughly 200 ms, players notice they can jump from thin air and the controls feel floaty.
Starting values
| Setting | Value | Note |
|---|---|---|
| Window | 80–150 ms | 5–9 frames at 60 fps |
| Starts | on the last grounded frame |