Prevent "bunnyhopping" when holding spacebar

I have a double jump system in place that I don’t want to mess with. I noticed, however, that when I hold down the space bar, I immediately jump again. Default controls are turned off and I do like the ability to hold the space down for variations in height, but I want to figure out how to limit the ability to jump from the ground to only be when I actually press it and not from holding. I’m including a picture of what I have setup for my double jump.

I think the issue with your events is that you have “Space is pressed”/“Trigger once” and the other conditions in the same event so the entire event will only trigger when everything is true and not just exclusively to the first frame the Space key is pressed.

Hey, I had the same issue a couple of times and tried to get it to work and optimize the code for it. This is the code I’m always using for double- or multi-jump. It’s rather flexible since you can freely change how many jumps the player has left and also what the jump count will be reset to via variables at any point.

Hope this helps :slight_smile:

3 Likes

I would try to move on top of your conditions the space key pressed and the trigger once just below and all other conditions below.
edit: like elairyx already posted
lol i’ve just noticed the necro…but this post was in the main page…i guess you can close this

1 Like

But it’s not so straightforward if you’re using the gamepad mapper behavior as well. This will not work with gamepads. It will only apply to keyboard mapped controls.

I am linking it for other ppl that get confused
Cause i know you found it already

This and my post below