how do you make button stay pressed/ touched

im trying to make a button that will stay pressed unless clicked for the second time, is there a way i could do that?

Comments

  • IceboxIcebox Member Posts: 1,485
    edited June 2015

    @vindictuss@yahoo.com

    Yes make an integer self attribute , call it switch ,

    make a rule , when touch is pressed
    change attribute self.switch to mod((self.switch+1),2)

    **This will change self.switch to 1 or 0 **

    then create a rule that says
    when attribute self.switch = 1

    do whatever you want

    otherwise
    do what ever you want .

    so now when you press on the actor it will either be 1 or 0 , if its one you can put in your rules and otherwise if its 0 you can put your other rules , and it will switch everytime you touch it.

    Edit : in case you didnt understand there is a youtube tutorial by gamesalad guru its called Mod , i couldnt paste the link cause youtube is not working at the moment on my computer sorry.

    Hope this helps , good luck

  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,880

    Try something like this.

  • vindictuss@yahoo.comvindictuss@yahoo.com Member, PRO Posts: 55

    thank you RThurman and IceBox1910 you helped me a lot :smile:

Sign In or Register to comment.