One-Way Platforms
A one-way platform is a ledge the character can jump up through from below and then stand on from above. It catches only a character that was above the top before the move and is coming down, checked along the whole move so fast falls cannot skip it. Down plus jump drops through.

Paste this to your AI
Copy it into Claude, Cursor or ChatGPT. It already has good values and the usual mistakes in it.
Add "One-Way Platforms" to my game.
What it should do: A ledge that is open from below and solid from above. It lets the player climb through platforms by jumping, stand on them, and drop back down on purpose, so a level can stack floors without walls and ceilings getting in the way.
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
platform: On the platform
air: In the air
dropping: Dropping through
ground --> air: jumps
platform --> air: jumps or steps off
platform --> dropping: down plus jump
dropping --> air: feet clear the top
dropping --> ground: lands on the ground
air --> platform: lands on top
air --> ground: lands on the ground
```
Use these starting values:
- jumpSpeed: 12 units/s
- dropSpeed: 3 units/s
- dropDepth: 0.3 units
- gravity: 32 units/s²
- maxFallSpeed: 20 units/s
Watch out for these common mistakes:
- Looking only at where the feet are now: Tell your AI: catch the character only if its feet were at or above the top at the start of the move and are at or below it at the end.
- A fast fall skips a thin platform: Tell your AI: check the whole move from the old height to the new one, not only where it ends.
- The drop lands again at once: Tell your AI: mark the character as dropping, ignore the platform while it is marked, and clear the mark once the feet are a margin below the top.
- Feet exactly on the edge: Tell your AI: count equal as above when deciding where the feet were.
- A platform right above the floor: Tell your AI: clear the dropping mark on every landing, not only when the feet pass the margin.
- Down alone drops the character: Tell your AI: ask for down and a fresh jump press together, so holding down alone never drops.
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 ledge that is open from below and solid from above. It lets the player climb through platforms by jumping, stand on them, and drop back down on purpose, so a level can stack floors without walls and ceilings getting in the way.
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: jumps
- On the platform → In the air: jumps or steps off
- On the platform → Dropping through: down plus jump
- Dropping through → In the air: feet clear the top
- Dropping through → On the ground: lands on the ground
- In the air → On the platform: lands on top
- In the air → On the ground: lands on the ground
Good starting values
| Value | Start with | What it changes |
|---|---|---|
| jumpSpeed | 12 units/s | How hard the character pushes off. It must be strong enough to rise above the platform, or the platform cannot be climbed. |
| dropSpeed | 3 units/s | The little push downward when dropping through. It moves the feet off the top at once, so the drop looks like a drop and not a pause. |
| dropDepth | 0.3 units | How far the feet must sink under the top before the platform can catch the character again. Too small and a thin platform catches it on the way down. Too large and a low platform is skipped. |
| gravity | 32 units/s² | How fast a rise slows down. |
| maxFallSpeed | 20 units/s | The fastest the character can fall. It also decides how thin a platform can be before a fast fall could skip it, if the platform is checked badly. |
What usually goes wrong
Looking only at where the feet are now
If the platform catches anything whose feet are at or just under its top, a jump that stops just short of the top gets snapped up onto it, as if the character was pulled by magic.
Fix: Tell your AI: catch the character only if its feet were at or above the top at the start of the move and are at or below it at the end.
A fast fall skips a thin platform
A character falling fast, or in a slow frame, can move from above the platform to below it in one tick. Checking only the end position never sees the platform.
Fix: Tell your AI: check the whole move from the old height to the new one, not only where it ends.
The drop lands again at once
With down plus jump the feet are still on the top for a moment, so the platform catches the character right away and nothing seems to happen.
Fix: Tell your AI: mark the character as dropping, ignore the platform while it is marked, and clear the mark once the feet are a margin below the top.
Feet exactly on the edge
A character whose feet are exactly at the top height, like one that stood there a tick ago, falls through if the check says strictly above instead of at or above.
Fix: Tell your AI: count equal as above when deciding where the feet were.
A platform right above the floor
Dropping through a platform that is lower than the margin has no room to clear it, so the mark could stay on after landing on the ground and make the next platform unreachable.
Fix: Tell your AI: clear the dropping mark on every landing, not only when the feet pass the margin.
Down alone drops the character
If holding down is enough, a player who holds down while landing on a platform falls straight through it, and crouching on a platform becomes impossible.
Fix: Tell your AI: ask for down and a fresh jump press together, so holding down alone never drops.
How to check it works
- Your character stands on the ground below a platform. Jump hard enough to rise above the platform: The character passes up through it and lands on top when it comes back down.
- Your character is just under a platform and rising. The next tick runs: The character keeps rising and is not caught.
- Your character is falling just above a platform. It reaches the platform: The character stands on the platform.
- Your character is at the top of a jump, its feet a hair under the platform. The next tick runs: The character starts to fall and is not lifted onto the platform.
- Your character stands on a platform with solid ground far below. Hold down and press jump: The character falls through the platform and lands on the ground.
- Your character stands on a platform. Hold down without pressing jump: The character stays where it is.
- Your character stands on a platform. Press jump without holding down: The character jumps up.
- Your character stands on solid ground. Hold down and press jump: The character jumps up.
- Your character has dropped through a platform. Its feet sink below the margin, and later it jumps up from the ground: The drop is over and the platform catches the character from above again.
- Your character falls at top speed in a slow frame. It moves from above the platform to below it in one tick: The character lands on the platform.
- Your character stands on a platform. It moves past the platform's edge: The character starts to fall.
Works well with
- Coyote Time: A late jump just after stepping off the side of a platform should still work, the same as off any ledge. Count the platform as ground when looking at the ledge.
- Moving Platforms: A platform that moves also needs the old top to judge where the feet were. Keep both. Move the platform first, then check the catch against its new top.
- Double Jump: An air jump from below a platform passes through it like any rise, so a second jump can reach a platform a single one cannot.
Clashes with Jump Buffering: A remembered jump fires on landing. If the player holds down, it becomes a drop-through right after landing on a platform. Let a remembered jump only jump, never drop. Drop only on a fresh press.
Common questions
how do i make a platform you can jump through from below
Paste this: Add one-way platforms: they catch the character only when its feet were at or above the top before the move, it is moving down, and the move ends at or below the top. Jumping up from below passes through. Pressing down plus jump drops through and ignores that platform until the feet are clear.
why does my character fall through a one way platform
Most often the check looks only at where the feet end up, so a fast fall skips a thin platform. Check the whole move from the old height to the new one.
why does my character get pulled up onto a platform
The check is asking where the feet are now. Ask where they were before the move. If they were below the top, the platform must not catch them.
how do i let the player drop down through a platform
Ask for down and a fresh jump press together. Then mark the character as dropping, ignore the platform until the feet are a small margin below its top, and clear the mark on any landing.
Where it comes from
We could not find a reliable origin for this one yet.
What was checked
- 18 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