The second jump in the air should feel like a jump, even while falling
Press jump again in the air and sometimes you barely slow down, sometimes you shoot far past the first jump. The bug is in how the new push is combined with the speed the character already has. Here is the rule that makes every second jump the same.
Why this works
The player presses jump to go up, whatever just happened. So the second jump must give the same kind of result every time, not one that depends on how fast the hero was falling. Setting the result, not adding, makes it dependable.
When not to use it
Skip it in a game whose levels are built around one jump, such as tall precise climbs or traps that a double jump would skip. Give the extra jump to special places or as a rare reward, so the designer still controls what is reachable.
In the full entry
- What to build, step by step
- Starting values and the reason for each
- 3 common mistakes and the fix
- 20 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 "The second jump in the air should feel like a jump, even while falling" (read_entry double-jump-sets-speed-not-adds) 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