wait until animation is done unity code example
Example 1: condition when a animation finishes in unity
if(anim.GetCurrentAnimatorStateInfo(0).normalizedTime > 1){ //If normalizedTime is 0 to 1 means animation is playing, if greater than 1 means finished
Debug.Log("not playing");
}
else{
Debug.Log("playing");
}
Example 2: unity wait for animation to finish
//if animation with name "Attack" finished
if (anim.GetCurrentAnimatorStateInfo(0).IsName("Attack"))
{
//do something
}