Jump sustain height doesn't work with custom controls

Hello folks from GDevelop, I found out recently a bug involving the new “Jump sustain height” added a good time ago in the program that allow the players in a platform game to jump on different heights based on how long they pressed the jump button.

As I was trying to apply it in my game, and getting puzzled about why it wasn’t working, I found the feature doesn’t work with custom controls. If using the default controls (Space for jumping), it works, but if using custom controls (Simulating the jump key), it simply doesn’t work and the character jumps on only one speed height regardless of how much the player keeps the button pressed. It happens with both the keyboard and with any gamepad.

And that’s pretty much it, thank you for your attention. :slight_smile: Even though this feature still needs some polishing, I feel confident it will become a good addition to Gdevelop in the future. :slight_smile:

I took the default platformer example and disabled default controls, and added this line, and I’m unable to reproduce the issue you mention.
Please provide an example project demonstrating the issue.

Hello Gruk, thank you for your attention! Well, when you uses “Space” like you did, it still works. Try mapping the jump button to another button, like the “Z” button, which is the one I’m using here.

Same, works fine with Z or B.

That’s very weird, then. I tried to recreate the problem here, and it happened again. I really don’t understand what’s happening, and why it works fine for you, Gruk, but not for me.

At least I was able to come with an alternative to implement some jump sustain height myself, but I really can’t help but find it odd how the in-built jump sustain height from the Platform Character Behavior works for you but not for me.

I’m really sorry for this, and thank you for your help in any case, Gruk.

Have you tried with the platformer example, like I did?
If you reproduce the issue with the example project, zip it and share it with us.
Who knows what might be going on!

When I first tried setting custom controls, I found this problem happened with a “Just once” set for the jump key

1 Like

Yes, this is a good callout. If you’re setting up Jump controls, and have trigger once, sustain will never occur.

I think that must be the problem. At first I thought it was something with the custom controls (namely, the keyboard text expression, used to allow the players to set their own keyboard configuration), or the gamepad, or even the AND expression (“If one of these conditions are true”).

But after reading your comments, I found out the problem you’ve described was the cause. You see, in the game I’m working in, you can jump when a variable called “jump_buffer” is set to 0. When you press the jump button, the value is set to 1 and it will continue like it until the player releases the button. I did this to avoid having the player keep hopping and jumping while keeping the jump button down (you fall, and if you keep the jump button pressed, you jump again, which is annoying).

Thank you for your help, guys, even though I can’t use the built-in jump sustain height, I really wish to thank you for helping me to understand what was happening. Thank you everyone! :slight_smile:

1 Like