**HELP WITH JUMPING**
CreativeJuicesEntertainment
Member Posts: 85
I tried making an actor jump with gravity (accelerating down) and changing the linear velocity Y, but the user can still press the jump button and continue to jump upward. I need to make it so that the actor can jump a max of 2 times (and I would also, if anyobdy knows how to, be able to change the max number of jumps to 3 or 4 easily if necessary). I also have the ability for the actor to move left and right, and when the actor is falling down from the jump the actor does not continue to fall but simply moves straight to the left or right, depending on which button you are pressing for the direction the actor will go. If anyone could help me with both or one of these things I would greatly appreciate. Any advice or even the code in GS to do it would be superb. If you need any other information to help me like screenshots or anything just let me know. Thanks!
Comments
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
Create this rule in your jump button:
When 'Jump button' receives touch, change attribute 'jump' to 'jump + 1'
In your hero create these rules:
When any of the following are happening:
If attribute 'jump' = 1
If attribute 'jump' = 2
Do:
Change velocity to 'x' in direction 90
Put another rule in your hero:
When hero overlaps with ground change attribute 'jump' to 0
I hope that can help you figure out your double jump. Good luck
EDIT: nvm, I actually found another way to do it that was very similar to yours. Thank you anyway!