- Home /
How do I tell if a Unity 4.0 Animator is finished?
There seems to be little documentation on how to tell if the new unity animator is finished. I have my animator not looping, but I want to destroy the associated game object when it is at the end. Everything I have found involves some string hashing and I was wondering if there is a cleaner way to do this like with the old animation. I am in 2D.
Answer by WhatMade · Sep 26, 2014 at 10:51 AM
Did you ever happen to get this figured out? I can't believe how little information on this there is. It's appalling.
No, we ended up switching to particle effects to give the illusion of animation.
Answer by 767_2 · Sep 26, 2014 at 06:05 PM
if(this.animator.GetCurrentAnimatorStateInfo(0).IsName("AnimationName"))
{
myStateBool = true;
}
else if (myStateBool)
{
myStateBool = false;
// do what you want to do after animation
}
another way is using normalaized time that it shows how many times the animation is looped
if (Animator.GetCurrentAnimatorStateInfo(0).normalizedTime > 1 && !Animator.IsInTransition(0))
Your answer
Follow this Question
Related Questions
Two models in animation, one flipped around pivot 0 Answers
unity Humanoid Animations Help 0 Answers
Mechanim issues 1 Answer
Animation Blending Problem.. 0 Answers
Mecanim altering character posture 0 Answers