Spielerando

Crouch Slide

A crouch slide starts when the player presses crouch while running fast. The character gets a capped boost, then only friction acts on it, with no steering. A pause before the next slide stops chains from stacking speed, and under a low ceiling the character stays low instead of standing up into it.

Also called: Slide, Power slide, Ground slide.

A fox courier in a magenta jacket slides on its hip along a glowing floor under a low steel beam, speed streaks behind it and a faint upright outline in front showing it would not have fit standing.
Neonvault Dash, an invented corridor-running game. Invented game, image generated with AI.

Paste this to your AI

Copy it into Claude, Cursor or ChatGPT. It already has good values and the usual mistakes in it.

Add "Crouch Slide" to my game.

What it should do: A slide turns running speed into a short, committed move: the character gets under low gaps, keeps momentum through a turn of play and makes a fast approach feel different from a slow one.

Build it exactly as this state machine. First check that it fits my game, then build it like this:

```mermaid
stateDiagram-v2
  [*] --> upright
  upright: Upright
  sliding: Sliding
  crouched: Crouched
  air: In the air
  upright --> sliding: crouch while fast
  upright --> crouched: crouch while slow
  upright --> air: leaves the ground
  sliding --> crouched: slows or no room
  sliding --> upright: stands up early
  sliding --> air: slides off an edge
  crouched --> upright: stands up, room above
  crouched --> air: leaves the ground
  air --> upright: lands
  air --> crouched: lands, crouch held
  air --> sliding: lands on a press
```

Use these starting values:
- runSpeed: 6 units/s
- crouchSpeed: 2 units/s
- accel: 40 units/s²
- minSlideSpeed: 4 units/s
- slideBoost: 1.25
- slideMaxSpeed: 9 units/s
- slideFriction: 9 units/s²
- slideCooldown: 0.5 s

Watch out for these common mistakes:
- Standing up under a low ceiling: Tell your AI: ask if there is room above before standing up. If there is not, stay low, and stand up only when there is.
- Holding crouch before the run: Tell your AI: start a slide only on a new press, so remember if crouch was held on the last tick.
- Chained slides stack up speed: Tell your AI: cap the start speed, add a short pause after a slide, and start only from a run, never from a crouch.
- Sliding off an edge: Tell your AI: end the slide when the feet leave the ground, keep the speed, and start the pause then.
- Steering the slide: Tell your AI: during a slide, ignore the direction. Only friction changes the speed.
- Slide boost that adds: Tell your AI: make the start speed a multiple of the speed before it, and set it, never add to it.

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 slide turns running speed into a short, committed move: the character gets under low gaps, keeps momentum through a turn of play and makes a fast approach feel different from a slow one.

How it runs, as a diagram

Everything it can be in, and what moves it on. Your AI builds from exactly this.

crouch while fastcrouch while slowleaves the groundslows or no roomstands up earlyslides off an edgestands up, room aboveleaves the groundlandslands, crouch heldlands on a pressUprightSlidingCrouchedIn the air
How it runs, as a diagram
  • Upright → Sliding: crouch while fast
  • Upright → Crouched: crouch while slow
  • Upright → In the air: leaves the ground
  • Sliding → Crouched: slows or no room
  • Sliding → Upright: stands up early
  • Sliding → In the air: slides off an edge
  • Crouched → Upright: stands up, room above
  • Crouched → In the air: leaves the ground
  • In the air → Upright: lands
  • In the air → Crouched: lands, crouch held
  • In the air → Sliding: lands on a press

Good starting values

ValueStart withWhat it changes
runSpeed6 units/sThe top speed when upright. The slide's start speed is built from it.
crouchSpeed2 units/sThe top speed when crouched, and the speed at which a slide turns into a crouch. About a third of running keeps crouched walking slow but not stuck.
accel40 units/s²How fast the speed moves toward what the player asks for. It makes up the change from slide speed to running or crouching.
minSlideSpeed4 units/sThe slowest speed a slide can start at. Two thirds of running speed means a slide needs a real run-up and slow walking just crouches.
slideBoost1.25The slide's start speed as a multiple of the speed before it. A quarter more makes it feel like a burst without breaking the level.
slideMaxSpeed9 units/sThe fastest a slide can ever be. About one and a half times running speed, so even a perfect run-up has a limit.
slideFriction9 units/s²How fast a slide loses speed. At this value a full slide lasts about 0.6 seconds, long enough to read and short enough to stay in control.
slideCooldown0.5 sThe wait after a slide before the next one can start. It is what stops a player from chaining slides forever.

What usually goes wrong

Standing up under a low ceiling

A player who lets go of crouch in a tunnel stands up into the ceiling, gets pushed out or stuck, or the slide cuts out and the character is thrown into a wall.

Fix: Tell your AI: ask if there is room above before standing up. If there is not, stay low, and stand up only when there is.

Holding crouch before the run

A player who holds crouch while running up slides the moment they reach speed. That feels like the game decided for them, and it makes crouch-walking impossible near the minimum speed.

Fix: Tell your AI: start a slide only on a new press, so remember if crouch was held on the last tick.

Chained slides stack up speed

If every slide multiplies the speed and a new one can start right away, a player taps crouch again and again and the speed grows without a limit.

Fix: Tell your AI: cap the start speed, add a short pause after a slide, and start only from a run, never from a crouch.

Sliding off an edge

The slide carries on in the air with the low body and its friction, or the speed is cut at the edge so the jump across a gap falls short.

Fix: Tell your AI: end the slide when the feet leave the ground, keep the speed, and start the pause then.

Steering the slide

If the player's direction still changes the speed, pushing back flips the slide in the middle. A slide that can be steered is just crouched running.

Fix: Tell your AI: during a slide, ignore the direction. Only friction changes the speed.

Slide boost that adds

A boost that adds a fixed amount makes a slide from a walk nearly as fast as one from a sprint, so running up no longer matters.

Fix: Tell your AI: make the start speed a multiple of the speed before it, and set it, never add to it.

How to check it works

Works well with

Clashes with Jump Buffering: A jump pressed just before landing and a crouch pressed at the same time both want to act on the landing tick. Let the remembered jump win, and start the slide only if no jump is waiting.

Common questions

what do i tell my ai to add a crouch slide

Paste this: Add a crouch slide. A new press of crouch while running fast starts a slide with a capped boost, only friction slows it, nothing steers it, it ends when slow or when the player stands up where there is room, and a short pause stops chained slides.

how long should a slide last

About half a second to two thirds of a second from a full run. Shorter feels like a stumble, longer takes control away from the player for too long.

should the player be able to steer a slide

No. A slide is a commitment, and that is its price. If the player can steer it, it is only a faster crouch walk and the move loses its point.

how do i stop slide chaining from getting out of hand

Cap the start speed, add a pause after each slide and only start from a run. Then the best a player can do is one slide per run-up, which stays easy to design levels around.

Where it comes from

We could not find a reliable origin for this one yet.

Where this mechanic comes from has not been researched yet.

Games are named only as references. Names and marks belong to their owners, and nothing here is endorsed by them.

What was checked

This is what separates the blueprint from a catalogue entry: the values on this page come from code that runs.

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