Variable Jump Height? Longer key presses yield a higher jump?

I don’t know why my question was merged in with this one. They are not the same at all.

The OP for this thread does not want the jump delayed until the key is released, but rather, the jump should just add more velocity (mid-jump) if the key is held down longer… Which can be accomplished with the CharacterMovement component included in the Character class.

So, to the OP:

In your Character’s Construction Script, drag off a node from the Construction node and type “jump hold”, under Character, look for “Set Jump Max Hold Time”. Then, I would make an editable variable so you can more easily edit this on your Character later.

Now, when you select your Character (top left), you should see your editable variable in the Details panel.

Over in your PlayerController, you also want to make sure that your only actually calling Jump when the player “Can Jump”; and also make sure to call “Stop Jumping” when you release the key.
Otherwise, you’ll be able to infinitely ‘double-jump’… going higher and higher… Which is probably not good.

I think that’s all it takes.

2 Likes