How do I make jump sustain with the Physics behaviour? Please help me!

Hi there! I’m in the process of making a boss fight, and I’ve run into an issue. I need to make minimum and maximum jump sustain times (how long the player stays in the air) in order for the player (which is using a Physics behaviour) to avoid attacks. I want the player to stay in the air for longer than normal if they hold down the jump key, but jump lower than normal if they quickly tap the input. As far as I know, this is not possible. Does anyone else know how to do this?

Hi, could you tell us what kind of game it is and why it needs the physics behavior?

A certain part of the boss fight is a platformer sequence and I need the Physics behaviour enabled for the player in order for another part of the sequence to function properly. Do you know how I could get this to work?

Generally, I would argue, that it is easier to work with the platformer behavior, especially when it comes to changing the jump time etc. But if you definitely need the physics-behavior this is not an option as both behaviors are not working well together.

You can measure the time a key is pressed. You just need to start a timer upon key press (you have to set the condition without ‘Trigger once’) and store the value of the timer in a variable which you can add or multiply to your jump value.
If you don’t want to use a timer, you can also store TimeDelta() in the variable instead.

1 Like

Thank you for your help!