Stamina drain when pressing jump button after already jumped

Hello, does anyone have any idea what I am doing wrong? The stamina recovery and everything work as planned, however when pressing the jump button in air after I already have jumped it drains the stamina. For example if i press the stamina 10 times while in the air the stamina drains 10 percent per press. Any idea how you can do so the stamina only drains when actually jumping and not while pressing the jump button in the air aswell?

add in an additional check for isFalling(). though it sounds like it should only check if the character is “moving downward” what it actually does is checks the Z component of the Velocity vector for if not Zero, so even if the character is moving upwards the IsFalling will still return true.
this will have the added effect in a Single Jump system to not allow for jumping while falling down.

Thank you so much!!!

Got it to work now!!!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.