Wall Slide
A wall slide slows a fall while the character presses against a wall. Limit the fall speed instead of setting it, so a slower fall stays slow and a rising jump is left alone. Keep the slide going for a short moment after the push is released, so a quick tap away does not drop the character.

Paste this to your AI
Copy it into Claude, Cursor or ChatGPT. It already has good values and the usual mistakes in it.
Add "Wall Slide" to my game.
What it should do: A slow slide down a wall gives the player time to look, aim and choose, and it turns a wall from a dead end into a place to stop and think.
Build it exactly as this state machine. First check that it fits my game, then build it like this:
```mermaid
stateDiagram-v2
[*] --> ground
ground: On the ground
air: In the air
slide: Sliding
ground --> air: walks off an edge
ground --> slide: steps off beside a wall
air --> ground: lands
air --> slide: falls against a wall
slide --> air: lets go or wall ends
slide --> ground: lands
```
Use these starting values:
- slideSpeed: 4 units/s
- letGoTime: 0.12 s
- gravity: 32 units/s²
- maxFallSpeed: 20 units/s
Watch out for these common mistakes:
- The slide sets the speed: Tell your AI: only limit the fall speed to the slide speed. A slower fall stays as slow as it is.
- Rising along the wall: Tell your AI: slide only while the character is falling or has stopped rising.
- A flicker of the push: Tell your AI: keep the slide going for a short let-go time after the push is released.
- The wall ends under the character: Tell your AI: look for the wall on every tick and end the slide at once when it is gone.
Do not change anything else in the game. Do not claim anything without proof: model what it takes, and show me what your solution rests on and how I can see that it works. If you cannot show something, say you do not know. When you are done, tell me in plain words how to try it.Or skip this and connect the MCP: your AI then finds all of this by itself.Connect the MCP
What it does
A slow slide down a wall gives the player time to look, aim and choose, and it turns a wall from a dead end into a place to stop and think.
How it runs, as a diagram
Everything it can be in, and what moves it on. Your AI builds from exactly this.
How it runs, as a diagram
- On the ground → In the air: walks off an edge
- On the ground → Sliding: steps off beside a wall
- In the air → On the ground: lands
- In the air → Sliding: falls against a wall
- Sliding → In the air: lets go or wall ends
- Sliding → On the ground: lands
Good starting values
| Value | Start with | What it changes |
|---|---|---|
| slideSpeed | 4 units/s | The fastest the character falls while sliding. A fifth of the normal fastest fall: slow enough to read the wall and time a jump, fast enough to still feel like falling. |
| letGoTime | 0.12 s | How long the slide goes on after the player stops pressing toward the wall. About the length of a quick tap, so a flicker of the stick does not end it. Zero ends the slide at once. |
| gravity | 32 units/s² | How fast a fall speeds up. The same as on the other movement pages, so they fit together. |
| maxFallSpeed | 20 units/s | The fastest the character can fall when not sliding. The slide never goes above it, even if the slide speed is set higher. |
What usually goes wrong
The slide sets the speed
If the slide sets the fall speed to the slide speed, a character that was falling slower suddenly speeds up, and the top of a jump turns into a drop.
Fix: Tell your AI: only limit the fall speed to the slide speed. A slower fall stays as slow as it is.
Rising along the wall
A slide that works whenever the character touches a wall also slows the way up, so every jump next to a wall falls short.
Fix: Tell your AI: slide only while the character is falling or has stopped rising.
A flicker of the push
Sticks and quick taps lose the push for a tick or two. Without a let-go time the slide ends, the character drops fast, and the jump away from the wall feels late.
Fix: Tell your AI: keep the slide going for a short let-go time after the push is released.
The wall ends under the character
At the bottom edge of a wall, a slide that is only switched off by letting go keeps the character falling slowly through open air.
Fix: Tell your AI: look for the wall on every tick and end the slide at once when it is gone.
How to check it works
- Your character falls fast next to a wall. The player presses toward the wall: The fall drops to the slide speed and stays there.
- Your character falls fast next to a wall. The player does not press toward the wall: The character keeps falling and speeds up as usual.
- Your character falls slower than the slide speed next to a wall. The player presses toward the wall: The fall does not jump up to the slide speed, it speeds up only as gravity does.
- Your character is rising next to a wall. The player presses toward the wall: The rise goes on as if there were no wall.
- Your character is sliding. The player stops pressing toward the wall for less than the let-go time: The character keeps sliding at the slide speed.
- Your character is sliding. The player stops pressing toward the wall for longer than the let-go time: The slide ends and the character falls faster again.
- Your character is sliding and the player keeps pressing. The wall ends: The slide ends on that tick.
- Your character is sliding just above the ground. It reaches the ground: It stands on the ground and is no longer sliding.
- Your character stands on the ground next to a wall. The player presses toward the wall: Nothing happens, the character is not sliding.
Works well with
- Wall Jump: A press that jumps off the wall must not be eaten by the slide. The slide is what keeps the character next to the wall long enough to jump. Check for the wall jump before the slide on every tick.
- Ledge Grab: At the top of a wall the slide ends and a ledge grab can begin. Let the grab win when both fit.
- Stamina System: A slide that costs stamina turns every wall into a short rest instead of a free stop. Spend stamina while sliding, and treat an empty bar like letting go.
Clashes with Double Jump: A press in the air next to a wall can mean a jump off the wall or an air jump. Let the wall jump go first and keep the air jump for when there is no wall.
Common questions
what do i tell my ai to add a wall slide
Paste this: Add a wall slide: when the character is falling and presses toward a wall, limit the fall speed to a slow slide speed. Never speed up a slower fall, leave rising alone, keep the slide for a short moment after the push is released, and end it on landing or when the wall is gone.
how fast should a wall slide be
A fifth of the normal fastest fall is a good start: 4 against 20 here. Much slower feels like glue, and much faster leaves the player no time to aim a jump off the wall.
should the wall slide need a push toward the wall
Usually yes. It lets the player choose to fall normally by letting go, and it stops the character from slowing down at every wall it brushes past.
why is my jump next to a wall too short
The slide is probably slowing the rise. Let it work only while the character is falling, and the jump will be the same next to a wall as in open air.
Where it comes from
We could not find a reliable origin for this one yet.
What was checked
- 17 tests pass on the reference code.
- The state diagram was checked against the code, at the default values and at every listed low and high value.
Your AI gets the code
Tested example code comes through the Spielerando connection, so your AI can use it right away. How to connect it