Spielerando

Moving Platforms

A moving platform travels back and forth along a path, waits at each end, and carries whoever stands on it. Move the platform first, then move the rider by the exact distance it moved, keep its feet on the top, and let a jump or step off keep the platform's speed.

Also called: Elevator platform, Lift platform, Carrying platform.

A small robot stands upright on a glowing cyan slab that glides up a magenta dotted rail between two lit stations over a dark gap, bright streaks trailing behind.
Nibblecast Rail, an invented neon courier platformer. 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 "Moving Platforms" to my game.

What it should do: A platform that travels on its own and takes the player along. It makes the player time jumps against a moving target, and it turns a gap or a shaft into a ride.

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

```mermaid
stateDiagram-v2
  [*] --> carried
  ground: On the floor
  air: In the air
  carried: Carried along
  resting: On stopped platform
  ground --> air: jumps or falls
  air --> ground: lands on floor
  air --> carried: lands, platform moving
  air --> resting: lands, platform stopped
  carried --> resting: platform stops
  resting --> carried: platform sets off
  carried --> air: jumps or steps off
  resting --> air: jumps or steps off
```

Use these starting values:
- platformSpeed: 3 units/s
- pauseTime: 0.8 s
- travelX: 6 units
- travelY: 2 units
- halfWidth: 1.5 units
- walkSpeed: 4 units/s
- jumpSpeed: 12 units/s
- inheritScale: 1
- gravity: 32 units/s²
- maxFallSpeed: 20 units/s

Watch out for these common mistakes:
- Carried by speed instead of distance: Tell your AI: move the platform first, then move the rider by exactly the distance the platform just moved.
- A platform that drops faster than gravity: Tell your AI: while the rider stands on the platform, put its feet on the top every tick instead of letting gravity pull it.
- A jump that forgets the platform: Tell your AI: when the rider leaves the platform, give it the platform's speed on top of its own push.
- A platform that rises into a falling rider: Tell your AI: judge the landing against where the top was and where it is now, not against the old top alone.
- Time lost at the turn: Tell your AI: when a tick reaches an end, spend the time left on the wait and then on the way back.
- Landing from below: Tell your AI: catch only a rider whose feet were at or above the top before the tick.

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 platform that travels on its own and takes the player along. It makes the player time jumps against a moving target, and it turns a gap or a shaft into a ride.

How it runs, as a diagram

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

jumps or fallslands on floorlands, platform movinglands, platform stoppedplatform stopsplatform sets offjumps or steps offjumps or steps offOn the floorIn the airCarried alongOn stopped platform
How it runs, as a diagram
  • On the floor → In the air: jumps or falls
  • In the air → On the floor: lands on floor
  • In the air → Carried along: lands, platform moving
  • In the air → On stopped platform: lands, platform stopped
  • Carried along → On stopped platform: platform stops
  • On stopped platform → Carried along: platform sets off
  • Carried along → In the air: jumps or steps off
  • On stopped platform → In the air: jumps or steps off

Good starting values

ValueStart withWhat it changes
platformSpeed3 units/sHow fast the platform travels. Slow enough that a player can step on and off, fast enough that waiting for it is not boring.
pauseTime0.8 sHow long it waits at each end. The wait is where the player gets on and off safely. Zero makes a platform that never lets go.
travelX6 unitsHow far the path goes across. Zero with a height makes a lift.
travelY2 unitsHow far the path goes up. Negative goes down. Zero with a width makes a flat ride. Keep the whole path above the solid floor, or a rider stepping off at the bottom lands on the floor at once.
halfWidth1.5 unitsHalf the width of the platform. It decides how far the rider can walk before stepping off.
walkSpeed4 units/sHow fast the rider walks on the platform and steers in the air.
jumpSpeed12 units/sHow hard the rider pushes off, counted from the platform, not from the world.
inheritScale1How much of the platform's speed a jump or a step off keeps. One is how the real world works. Zero makes jumps feel stuck to the spot, and a rider on a fast platform lands behind it.
gravity32 units/s²How fast a rise slows down.
maxFallSpeed20 units/sThe fastest the rider can fall.

What usually goes wrong

Carried by speed instead of distance

If the rider is moved by the platform's speed before the platform has moved, or after it, it is one tick behind. It slowly slides back, or jitters when the platform turns.

Fix: Tell your AI: move the platform first, then move the rider by exactly the distance the platform just moved.

A platform that drops faster than gravity

A rider that only falls with gravity is left floating above a platform that sinks faster, then bangs back down onto it. It looks like the platform shakes.

Fix: Tell your AI: while the rider stands on the platform, put its feet on the top every tick instead of letting gravity pull it.

A jump that forgets the platform

A jump counted from the world's standstill drops the rider behind a platform that moves sideways, and a jump from a rising platform comes out weak. Jumping off a falling platform comes out strong.

Fix: Tell your AI: when the rider leaves the platform, give it the platform's speed on top of its own push.

A platform that rises into a falling rider

A rider falling just above a platform that rises quickly can end the tick below the top and be missed, because the check only looked at the rider's move and the old top.

Fix: Tell your AI: judge the landing against where the top was and where it is now, not against the old top alone.

Time lost at the turn

A tick that reaches the end of the path and just stops there loses the rest of its time. Slow frames then make the platform slower overall, and two machines drift apart.

Fix: Tell your AI: when a tick reaches an end, spend the time left on the wait and then on the way back.

Landing from below

A rider jumping up from under the platform gets pulled onto it, because after the move the feet are at or below the top and the check forgot to ask where they were before.

Fix: Tell your AI: catch only a rider whose feet were at or above the top before the tick.

How to check it works

Works well with

Clashes with Jump Buffering: A remembered jump fires on landing. On a moving platform the landing and the jump happen in one tick, and the jump must still pick up the platform's speed. Run the landing first, then the remembered jump, in that order, and carry on from the platform's new place.

Common questions

how do i make a moving platform that carries the player

Paste this: Add a moving platform: move the platform first, then move the player who stands on it by exactly the distance the platform moved, and put its feet on the top. A jump or a step off keeps the platform's speed.

why does my player slide off a moving platform

The player is moved before or after the platform, so it is a tick behind. Move the platform first, then move the player by the distance the platform just moved.

why does my player shake on a moving platform going down

Gravity pulls the player slower than the platform sinks, so it hovers and then bangs down. While the player stands on the platform, put its feet on the top every tick.

should a jump from a moving platform keep its speed

Yes, in most games. The player already moves with the platform, so leaving it at a standstill feels like being thrown backward. A setting between none and all lets you tune it.

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