I know that Animation.IsPlaying allows me to check if any animation is playing, but how can i check if a specific animation is playing?
Apr 07 '10 at 01:52 PM
Check the enabled property of the desired animation:
if (animation["funnywalk"].enabled == true)
print("funnywalk is playing.");
Apr 07 '10 at 02:37 PM
This does work indeed, whereas animation.IsPlaying("funnywalk") might wrongfully return true from time to time (it seems). Any idea why?
Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.
Once you sign in you will be able to subscribe for any updates here
Answers and Comments
The best place to ask and answer questions about development with Unity. Check out our FAQ for more information.
To help users post good questions and use the site effectively we have posted a tutorial video. Please check it out.
asked: Apr 07 '10 at 01:52 PM
Seen: 5707 times
Last Updated: Apr 07 '10 at 01:52 PM
Can I make animations snap to a frame?
How to select an animation clip by index number?
Adding animation clips via script
Can the animation editor create local rotational data?
Reverse animation at the point it stopped playing
Resetting a combo attack chain if next attack did not occur in time
Why doesn't this animation script work?
Sharing animations with models
scripting for Animation Editor animations
Why don't stepped keyframes work in unity?