Actors and behavior on pressed
![Titam](http://forums.gamesalad.com/applications/dashboard/design/images/defaulticon.png)
Hi there,
A little issue I can't fix, example to understand :
I have a Button (actor1). I click on actor1, hop, a new actor (Actor1) is called, in front of Actor1. I want to push on actor2, but the behavior for actor1 is called also. How to "deactivate" the actor1 behavior in this case to avoid every pression to run the rule on this actor1 which is behind (physically) actor2 ? ^^
If it's not clear, I can make a draw![;) ;)](http://forums.gamesalad.com/plugins/emojiextender/emoji/twitter/wink.png)
Thanks !
A little issue I can't fix, example to understand :
I have a Button (actor1). I click on actor1, hop, a new actor (Actor1) is called, in front of Actor1. I want to push on actor2, but the behavior for actor1 is called also. How to "deactivate" the actor1 behavior in this case to avoid every pression to run the rule on this actor1 which is behind (physically) actor2 ? ^^
If it's not clear, I can make a draw
![;) ;)](http://forums.gamesalad.com/plugins/emojiextender/emoji/twitter/wink.png)
Thanks !
Best Answer
-
MotherHoose Posts: 2,456
when: actor1 … has spawned actor2 …
what: tell computer actor1 is done responding to touch
on actor1 add:
actorAttribute … boolean type … done
Rule: when
Event: touch is pressed
Attribute: self.done is false
-Spawn actor2
-changeAttribute: self.done To: true
then actor1 will do nothing when touch is pressed again
… you can always change self.done to false again with a timer or another ruleMH
Answers
Thanks !!