Predict which platform an enemy lands on when it walks off a ledge
A pursuer steps off an edge on purpose to reach you, but sometimes lands somewhere useless or in the pit. Here is how to work out the landing spot ahead of time, which platform wins when several are below, and what the unit's width changes.
Why this works
A falling unit keeps its sideways drift while gravity pulls it down, so where it ends up is fixed the moment it steps off. The first surface it touches on the way down wins, which is why the highest catching platform matters and not the nearest one.
When not to use it
Don't use it when the unit can steer or flap in the air, or when platforms move or crumble while it falls. The prediction is then out of date before the landing. Re-check every few moments during the fall instead.
In the full entry
- What to build, step by step
- Starting values and the reason for each
- 3 common mistakes and the fix
- 16 lines of example code with 4 checks that pass
- How your AI shows you that it works
Say this to your AI
Use the Spielerando entry "Predict which platform an enemy lands on when it walks off a ledge" (read_entry where-a-falling-enemy-lands) in my game. Build it step by step, and show me how you checked that it works.Or skip this and connect the MCP: your AI then finds all of this by itself.Connect the MCP