How do I make an actor jump?
I need to now how to make an actor jump.
In my scene I have a jump button and the actor. I want to know to make the jump button make the actor jump.
Help would be awesome. Thanks
In my scene I have a jump button and the actor. I want to know to make the jump button make the actor jump.
Help would be awesome. Thanks
Comments
In my scene I have a jump button and the actor. I want to know to make the jump button make the actor jump.
Help would be awesome. Thanks
First off make a integer game attribute, call it jump, and set it to 0.
Next in your jump button have a rule when touch is pressed
-change attribute jump to 1
then open up the otherwise section of that rule and have a change attribute behavior changing jump to 0
then finally in the actor you want to jump have a rule when attribute jump=1
change attribute self motion linear velocity y to 350
hope that helps
In your other actor, create a rule: When Attribute "game.Jump" is true, Change Attribute "self.motion.Linear.X" to [any positive number you like. Edit it to suit you]. NOTE: If the Scene Gravity is enabled, ignore the last step: In the otherwise section of the latter jump rule, put a Move behavior with the dial turned to 270. {Change the speed to suit you}.
Hope this helps! If you're new here, then welcome. I would advise you to check out the CookBook, the tutorials at YouTube [http://www.youtube.com/user/GameSaladCookbook]. Just a thought.
Again, welcome to GameSalad!