Jump Sustain Time

Hi, So after lots investigating and trying different methods I feel I have found a really good fix for solving the continuous jump logic of the base platformerObject logic and getting it to only jump once per press.

Now my issue is this logic and any other logic I have tried to stop multi-jumping interferes with the Jump Sustain Time of the base logic (tapping jump equates to small jump and pressing jump for a fraction longer leads to bigger jump). I have tried for the past three nights to fix this using timers and all sorts. Does any one have any simple logic they could share to enable a tap for a small jump and a press for a bigger jump. I even tried chatgtp but it assumes somethings are present in gdevelop that are not. Maybe its referencing an older version. Any help as always is appreciated.

Your method is making it harder for you than you want, but you are close to the right path.

Unfortunately, you are going to need a few more events to account for once per press logic and sustain.

Here are my events that include once per press, jump sustain, and coyote time.

Note: you will definitely want to reduce the coyote time timer, I was just using 1 second to test it. Most games use about 5 frames or 0.0833 seconds.

1 Like

Thanks for this, plus your help in previous weeks. The coyote timer bit confuses me. Is this a timer that is already present in the base playerObject logic. Or is it created at the start of your logic/code block when you define the event, player is on floor, not jumping, not falling. Again thanks.

Correct, it is started (and restarted) continually when the player is first on the floor.

Coyote time helps the game “feel” more fair to the player, it allows them a few frames after they start falling to still jump, rather than having to ve pixel perfect. Computers are much faster than the human eye, so people may feel like their jumps are being ignored whereas they actually just fell off the ledge before they could hit the jump button.

Hi, So I managed to get your code in and working. Only one jump per press until you release the jump button (which is great). But it has the same issue as my original code of nerfing the strength of jump option from the platformerObject logic. If I tap the button my player object jumps the same height as an extended holding of key. Any clues what might be causing this in the logic? Again, cheers for any help.

Do you jave a higher jump acceleration? If its over the max it might just be hitting the maximum even with a small press.

Yeah, Jump speed is at 480. Any less and the player doesn’t jump high. I’m beginning to think I might need to turn off default controls and figure out how to do the logic myself.

One I sort this jump issue I can finally start on figuring out platforming. Its the last hurdle in the very basic player code.

Took a while but I managed to get small jump with a tap of the button and a larger jump when held. In the end very simplistic code attached to the end of your code worked.

Now I can just alter the numbers to get the right sized jumps.

Oh! I didn’t know you were using default controls. I apologize, I should have mentioned that default controls don’t have a way to stop you from doing the bunnyhopping fully.

By setting up your own controls (or even just reusing the same control keys and disabling default controls) you’d be fine, as you’ve discovered.

1 Like