Actor not destroying when tapped..?
justinodunn
Member, PRO Posts: 226
in Tech Support
So i made an actor when tapped 4 times, it will destroy itself. the code works like this.
when actor overlaps/ collides with invisible actor, change attribute self.touch to self.touch+1.
when self.touch= 4, after 0.7 seconds, change attribute self. touch to 0, destroy..
and no matter how many times i tap the actor, it doesnt destroy?
when actor overlaps/ collides with invisible actor, change attribute self.touch to self.touch+1.
when self.touch= 4, after 0.7 seconds, change attribute self. touch to 0, destroy..
and no matter how many times i tap the actor, it doesnt destroy?
Comments
Are you destroying it based on the number of times you tap it, or the number of times it collides/overlaps?
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
Otherwise, you may find that self.touch is greater than 4 and your existing rule isn't firing.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Create a new integer attribute called Taps and set it to 0.
Then create a rule in the actor.
When actor receives event touch is pressed, Change attribute game.taps to game.taps+1.
Then create another rules.
When attribute game.taps=4
After 0.7 seconds Destroy.
http://tinypic.com/view.php?pic=2m4odxh&s=8#.UxxiVvRdV4U
Sorry the other picture was wrong this one is correct
http://tinypic.com/view.php?pic=5463rs&s=8#.UxxirvRdV4U
Hi, your Rules look OK; so to my mind, the reason it's not working is one of two things:
• Either you've not put game.Taps (the one on the right hand side of the Change Attribute behaviour) via the drop downs in the Expression Editor, (in other words, it's just been typed in) or
• Your attribute game.Taps isn't an integer, real or index.
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps