Problem is not reproducible or outdated
animation.Play() won't work
Hi guys, here's my problem: The animation in the firts if statement (fill1) won't play. All the other animations work, so it's not caused by the animator, the print("fill1"); appears in the console and I've also tried switching the animations between the differend if statements; fill1 will play, if it's beeing called by a differend statement and none of the other (normaly working) animations won't play either if they're in the fill1 if statement. So I've tried everything I could think of and I really hope somone knows a sollution cause I'm pretty helpless at the moment. Thank's in advance Jay
public IEnumerator fill()
{
yield return new WaitForSeconds(.01f);
if (mixCounter == 2 && match == false)
{
mixAnim.Play("fill1");
print("fill1");
mixer.SetActive(true);
}
if (mixCounter == 1 && match == false)
{
mixAnim.Play("fill2");
}
if (mixCounter == 0)
{
mixAnim.Play("fill3");
finished = true;
}
}
Answer by Cuttlas-U · Apr 27, 2020 at 08:07 AM
hey , as i can see the code has no problem ( but its not optimised at all :D ) so the problem can be where u are calling the function , maybe u calling the IEnumerator multiple with different values on "mixCounter " so the animation changes ,
Follow this Question
Related Questions
Multiple enemies and no animations 0 Answers
How do I modify animation parameters from script (C#) 1 Answer
Play animation once (when down key pressed) in c# 1 Answer
[C#] Enum not working properly 2 Answers
Animation/Movement Error 1 Answer