GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

How to avoid multiple touches on an actor by user

helpingtogrowhelpingtogrow Posts: 72Member, PRO

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 Posts: 380Member, PRO

    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 Posts: 11,868Member, Sous Chef, PRO, Senior Sous-Chef

    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.