CLICK AND UNCLICK

oldefaitholdefaith Member Posts: 23
edited November -1 in Working with GS (Mac)
i want a button to click and change image to an "armed" state.... how would i click and have it stay clicked thus arming an ability, then unclick to deactivate?

Comments

  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    make a interger attribute called abilityOn and set it to 0

    Have a rule in the button you want to click to turn it on as so:

    When touch is pressed
    -change attribute abilityOn to (abilityOn+1)%2

    Then make a rule in the actor you want to change image as so:

    When attribute abilityOn=1
    -change image to armed image
    --then open up the otherwise section of that rule and put a change image behavior changing to the unarmed image

    cheers
  • oldefaitholdefaith Member Posts: 23
    worked perfectly thank you
Sign In or Register to comment.