- Home /
Mecanim animation
All I need to know is if my animation state "Rifle_Reload" is not playing, but there is no documentation saying how to do this. I have looked at other answers but they don't seem to work. I work in c#. Thanks
Do you actually need to know if it is playing, or do you need to know if it has finished playing?
EDIT: Is your animation using the Unity animation system?
I need to know if the animation is not playing, Because I need to know when i can let the player fire the gun (after he has finished reloading). And the reload was made using the unity animation system.
http://answers.unity3d.com/questions/187907/how-to-add-keyframes-on-imported-read-only-animati.html Take a look at this. There is a step-by-step guide in the answer. You have to add an animation event to your animation that fires at the end. Then change a bool to true or false when it happens.
This doesnt work, is there not a simpler way of doing it ?
Answer by SnotE101 · Oct 21, 2014 at 07:13 PM
Use .enabled == true or false.
how ? that will just enable or disable the whole animation controller
Note the double equal signs. That will check if it is enabled or not enabled.
Your answer
Follow this Question
Related Questions
How can I get the legnth of an animation? (Mechanim Animator/C#) 2 Answers
Root motion handled by script. How to still use root motion with disabled navmesh agent? 0 Answers
GetComponetInChildren for 2+ animator 2 Answers
Distribute terrain in zones 3 Answers
The name 'Joystick' does not denote a valid type ('not found') 2 Answers