Why does animation event calls twice if put it on certain frames?
As shown in the image, I have an animation event call HitTarget() on the first frame. And another event AnimationFinished(). Both functions use different delegate to trigger two functions in another manager class. HitTarget() will trigger a function with a print() statement, and AnimationFinished() will trigger a function that destroys this game object.
The problem is if I set it as shown in the image, the HitTarget() will be triggered twice. One at the beginning, and one in the end(there's an obvious interval pause between two printed message in log). However if I only move the HitTarget() to the 2nd frame, or if I only move the AnimationFinished() to the 0:05 frame, the HitTarget() will only be triggered once correctly. If I only move the AnimationFinished() to 0:07 frame, it'll be triggered twice.
What would possibly cause this problem? Thanks!
and I had that problem before, apparently when the animation is not in this loop runs back till the first frame, as if reading speed of the function that is on the last frame, being slow. not if you fences angry with this but. You have the animation loop. if you want only this active and do not run, remove the infinite loop
Thanks for your reply, though I don't quite understand your English. Do you mean I should uncheck the "Loop Time" check box on the animation file?
Answer by Sun-Pengfei · Jul 26, 2016 at 03:16 PM
Uncheck the "Loop Time" check box on the animation file would solve this problem. Thanks to @PhantomSarcasm
forgives English is not my native tongue, and I'm using google translator. if it is, it is not very good. but it is a translator at hand.
jajajajajajaajajajajaajajajajaajajajaaja
I am happy to have been of help
:V