- Home /
Wait for animation to finish? Animator.SetBool...
Hey guys, making a simple combo system and I need a way to essentially do...
animation.PlayQueued("AnimName", QueueMode.CompleteOthers)
//Using this
Animator anim1 = etc...;
switch(case)
case 1:
anim1.SetBool("Combo1",true);
yield return new WaitForSeconds(animation in state.length);
anim1.SetBool("Combo1", false);
case 2:
wait for anim 1 to finish ...
anim1.SetBool("Combo2",true);
etc....
Not sure if I can access animations within the animator to get their length?
Should I just stick to the old animation system, or do you guys have any suggestions. Thanks a bunch =)
Answer by Cherno · May 05, 2014 at 09:17 PM
I'm not sure if I understand your specific question, but I can say that you can access to length of an animationclip.
yield WaitForSeconds (animation[yourAnimation].length)
Hope that helps. If not, good luck anyway :)
Edit: Of course, it also works as a Coroutine if using C#.
Your answer
![](https://koobas.hobune.stream/wayback/20220613144327im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
2D Animation does not start 1 Answer
How to fix broken combo animation? 1 Answer
How can I play an queued animation based on sprites? 0 Answers
Animator.GetCurrentAnimatorStateInfo(0).IsName("FallOffBed") unexpectedly returns false 0 Answers
Determine in which frame is an Animation currently 2 Answers