Help with controlling amount of time a button can be pressed

Is there a way to control the amount of time a button can be pressed? I'm trying to figure out a way to have a button only be tapped and not depressed for a long amount of time. I'm thinking something involving a timer but I can't quite figure it out. Any suggestions???

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited April 2014

    When touch is pressed change attribute self.action to true Timer after 0.3 seconds [run to completion NOT checked] change attribute self.action to false

    When touch is released AND attribute self.action is true [whatever behaviors you want to occur] change attribute self.action to false

    Adjust the timer duration to your liking.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • RyanDenyseRyanDenyse Member Posts: 9

    @tatiang‌ Thank you for the response! This may be something silly I'm overlooking but when I'm in the change attribute box, I can't find the "action" option. I know I have to click the character name first and then it takes you to the next set of options, but I'm not seeing "action" or anything similar.

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    That's a custom attribute. Open the actor and click the + at the bottom of the list of attributes to add a boolean attribute. You can name it anything you like; I just chose "action."

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • RyanDenyseRyanDenyse Member Posts: 9

    @tatiang‌ Ok! Thanks so much for the help!

Sign In or Register to comment.