when animation start Unity freeze. Also whenever I use while loop Unity freeze. This is my code
void Update()
{
while(AnimationIsPlaying("myAnimation"))
{
Debug.Log("Animation Is Playing")
}
}
bool AnimationIsPlaying(string stateName)
{
return (myAnimator.GetCurrentAnimatorStateInfo(0).IsName(stateName) &&
myAnimator.GetCurrentAnimatorStateInfo(0).normalizedTime < 1.0f);
}
↧