How do I use JumpMaxHoldTime

Hey so I was wondering how do I use JumpMaxHoldTime because right now no matter what I set it to, if I hold the space bar, my character will just forever go upwards until I release it. On the space bar pressed I call Jump() and on space bar released I call StopJumping(). Is it something to do with JumpZVelocity, and do I have to change that? Also does JumpZVelocity have any relation to JumpMaxHoldTime?

Any help is much appreciated, thank you! :smiley:

JumpMaxHoldTime is the time in seconds after you press Jump, that the character stops getting vertical force. For a game like Super Mario Bros. it is set to about 0.5 seconds.

So, with JumpMaxHoldTime set to 0.5:

  • If you press jump for 0.001 seconds, your character will do a very small jump.
  • If you press jump for 0.25 seconds, your character will do a medium jump.
  • If you press jump for 0.5 seconds, your character will perform the highest jump possible.
  • If you press jump for 1 second, your character will do the same jump described above.

It’s related to JumpZVelocity in that they both change how high the character can jump, but otherwise, they are unrelated. (JumpZVelocity is describing force, JumpMaxHoldTime is describing time).

Hope this helps!

1 Like

This helps so much! Thanks for clearing it up for me! :smiley: