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:

1 Like