Advanced jump mechanic

524
525
1
2

The Red block is a "Collision Jump" found in the Run and Jump bundle. It's bad, don't use it.

The Green block is a "Y Velocity Jump", which is something I custom built, a jump that can't be broken.

Jump as much as you want, but if you jump exactly when you flash blue, the Red block will break and stop working. The Green block is always ready to jump and will never lock out. You also will never have to worry about wall clip jumping or double jump glitches.

What happens is when the Red block hits collision, it unlocks a switch, and when you hit jump, it locks, but if you hit jump on the same frame as collision, it doesn't unlock and you can't jump or hit collision anymore.

The Green block is different. Basically the idea is an object not moving registers as 0 velocity. Anything above or below 0 filters a lock, that way you can't jump again if you are jumping up or falling.

Use this method for a bug-free jump.

::NOTICE::

If your game uses hills or slopes, use TEST 2. It's a hybrid mechanic that unlocks when Y Velocity is vibrating on a nonflat surface, by flashing red when colliding, and flashing gold when raycasting. There's still a small window of frames where you won't get a good jump off of stairs, but it's the best option by far, even if you don't use slopes.

Editor