how to make my charecter jump with a jump button???

Hipster_Owl_StudiosHipster_Owl_Studios Member, PRO Posts: 214
edited November -1 in Working with GS (Mac)
I need to learn how to make my charecter jump with a jump button that i made on screen? ive tried it before and i used a game attriburte (integer) but when i did that my charecter only jumped once because my jump button was only functional once.. so can somone tell me another methoed to make my charecter jump using a jump button like for instance a boolean attribute thanks!!

Comments

  • jweaver911jweaver911 Member Posts: 439
    you need to make an "otherwise" state for the button. So that when you're not pressing it, the attribute that triggers the jump is reset.
  • design219design219 Member Posts: 2,273
  • FatalCrestFatalCrest Member Posts: 113
    Haha I had the same problem before

    Go ahead into the Scene Settings and make another layer so you can put
    your HUD elements in there, call it Control Layer and uncheck scrollable.
    (Place your other controls in there too like left and right movement)
    (Btw: I tend to use touches instead of anything so you might have to change some stuff)
    (Make sure you have gravity on also)

    Okay what you'll need are:

    Actors:
    Your button actor
    Your character
    Platform

    Others:
    onGround (Boolean set to false)
    jumpTrigger (Integer)

    Okay now for your Button Actor

    -If Actor is touched
    Change Attribute jumpTrigger to 1

    For the Character

    - If jumpTrigger = 1 and onGround = true
    Accelerate 90" (set whatever speed you want)

    - If Actor collides or overlaps with Platform
    Change Attribute onGround to true

    That should about do it! Enjoy! xD
Sign In or Register to comment.