|
I've used this as a door opening script:
How do I cancel the "hit.gameObject.animation.Play("Door_Open");" function after the animation been played?
(comments are locked)
|
|
A function can't be "canceled" from outside the function, but that's not necessary. Play() just starts the animation. With Stop() you can stop a running animation at anytime. But i guess you just want the animation to stop automatically at the end. You have to set the wrapmode of your animation to WrapMode.Once, that's all. In your case it should be That didn't work for me, so I just made the and animation cancel its self.
Jun 27 '11 at 06:24 PM
EytanTKing
What do you mean with "it didn't work"? What did not work? If the wrapmode is set to once the animation will cancel itself when it's finished.
Jun 27 '11 at 06:39 PM
Bunny83
Yes the animation stopped, but after words when the player collided with the door it played the animation again.
Jun 29 '11 at 06:39 AM
EytanTKing
(comments are locked)
|
