Running at a low wall: vault it, jump it, or stop in front of it
In a shooter, a crate or low wall should be crossed smoothly when you run at it, but not when there is nothing to land on behind it, or when it is too tall. Here is the decision that picks the right move, and the checks that stop the character from vaulting into a pit.
Why this works
One button should do the sensible thing. The character looks at what is in front: how tall the obstacle is, how fast it runs, and what lies behind. Going in that order rules out the silly outcomes, like vaulting into a pit or over a wall from a standstill.
When not to use it
Not for games where players want full say over every move, such as precision platformers; a hidden choice there feels like the game taking over. Offer separate buttons for vault and jump instead, and keep the automatic choice for cover shooters.
In the full entry
- What to build, step by step
- Starting values and the reason for each
- 3 common mistakes and the fix
- A diagram of every state
- 24 lines of example code with 3 checks that pass
- How your AI shows you that it works
Say this to your AI
Use the Spielerando entry "Running at a low wall: vault it, jump it, or stop in front of it" (read_entry cover-vault-or-jump-or-blocked) 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