4.2.2
Hi, so i would like to add a jumping system similar to celeste/hollow knight in which tapping the button makes you hop and holding it down results in a jump in gdscript
Thanks in advance
4.2.2
Hi, so i would like to add a jumping system similar to celeste/hollow knight in which tapping the button makes you hop and holding it down results in a jump in gdscript
Thanks in advance
You mean the basic idea that the length of the jump is depending on the duration te button is pressed?
I’ve never considered a short jump in Celeste a ‘hop’.
To answer the question: just cut the jump short when the player isn’t pressing the jump button anymore.
Like this (not actual code obviously)
If not input.pressed (jump):
*stop jumping. For example, velocity = 0. But actual implementation depends on the way you choose to implement jumping.
Optionally, you can choose to decrease the vertical velocity instead of cutting it short. Depends on what you’re going for.