When touch is released -> Animate (then disable touch)

Hi guys,
Im new at gamesalad and so far I like what I've seen.
I have a project going on wich does the following:
Actor receives event -> touch is released
Animate
(26 images that animate)
The problem is that after the touch has been released it should disable the touch so the user can't touch the actor while animating. At the moment when it's touched again while animating it starts back from the top. I need it to finish the animation without restarting.
Is there a way to do this?
Thanks,
Engin
Im new at gamesalad and so far I like what I've seen.
I have a project going on wich does the following:
Actor receives event -> touch is released
Animate
(26 images that animate)
The problem is that after the touch has been released it should disable the touch so the user can't touch the actor while animating. At the moment when it's touched again while animating it starts back from the top. I need it to finish the animation without restarting.
Is there a way to do this?
Thanks,
Engin
Comments
Thanks for the quick reply.
Unfortunately I can't seem to make it work. As I said I'm pretty new at gamesalad and have a lot to learn.
The first thing is that I don't know where to create a new boolean calling it "canTouch".
I tried at the scene but thought how can this effect the actor? So I created a new boolean on the actor calling it "canTouch".
I created a new rule:
attribute -> self.canTouch is True
(then in the behaviours)
Rule:
Actor receives event -> touch is release
Animate
(and then the 26 images)
On the preview it works. When i click on it it animates.
Now I have to create a rule that states canTouch = false and this is where I get stuck.
Adding a "Change Attribute" I get the Expression Editor and if I put in "false" or "1" or "0" it does nothing. It doesn't animate my actor anymore.
I'm a little stuck here and some help would be appreciated.
Thanks,
Engin
I see where you're going with this but this is not actually what I want.
I have a ball rotating 180 degrees from its pivot point. When the ball is touched it animates it by rotating. But the downsize is that when it's animating you can touch it again and thus it stops the animation and starts all over.
What I want is that the touch function should be disabled while the ball is rotating untill it's finished...
Engin
self.can touch should be set to true
have a rule when touch is pressed AND self.can touch is true
in that rule put your animate behavior, and a change attribute behavior changing self.can touch to false
then have a timer in that rule after(how many seconds your animation takes) with run to completion checked, and have a change attribute behavior in that timer changin self. can touch to true
that will work since while the animation is taking place, can touch will be false so it wont re animate, and you can only re animate once the last once has finished
cheers
Will post the game if it's finished
Engin
you could nest(add) a Rule under your animation...
when self.Image = (last image in animation)
changeAttribute game.canTouch To: true
MH