My jump animation is working fine when just pressing the space bar, but when I spam it or press it again at the second my character touched the ground, the animation becomes stuck at the first frame
Here is a gif :
As you can see, the first 2 jumps worked fine, but the last 2 ones got stuck at the first frame…
Try adding a delay after you press space once so that the spamming can’t happen. You could try with delay as long as the animation for jump or a little shorter. Unless of course, you want to be able to spam it without any bugs.
I’ve never done this type of thing, so I can’t help anymore than suggesting this and I’m not sure if it’ll work.
The way I’d handle it is that when you execute the jump function, just prior to that have a Is Falling? check which covers both going up and coming down (essentially if gravity is affecting your movement velocity or direction) and then if that comes back False, proceed with the jump but if it’s true, do nothing and ignore the input.