How to avoid multiple touches on an actor by user

helpingtogrowhelpingtogrow Member, PRO Posts: 74

Hi,

How do I avoid multiple "touches" on an actor. When the user touches

an actor I want it to do a number of actions but I only want these actions

do be done once not multiple times if the if the user touches it many times.

Comments

  • bob loblawbob loblaw Member, PRO Posts: 793

    do you mean like (for example) a jump function so the player only performs the jump once until the touch is reset to do it again?

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

    This is the exact kind of thing that a change in attribute value combined with a rule condition will allow you to do. Create a boolean called self.touched.

    When touch is pressed AND attribute self.touched is false
         [do actions...]
         Change attribute self.touched to true

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

Sign In or Register to comment.