Answers for "check if animation is playing unity"

5

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");
 }
Posted by: Guest on June-10-2020
1

unity animator check if animation is playing

bool isPlaying(Animator anim, string stateName)
{
    if (anim.GetCurrentAnimatorStateInfo(animLayer).IsName(stateName) &&
            anim.GetCurrentAnimatorStateInfo(animLayer).normalizedTime < 1.0f)
        return true;
    else
        return false;
}
Posted by: Guest on September-23-2020
0

unity detect if animation is playing

if(this.GetComponent<Animator>().GetCurrentAnimatorStateInfo(0).normalizedTime >= 1)
{
	//Do something when animator isn't playing
{
Posted by: Guest on March-08-2021
0

check if animation is playing unity

if (myAnimator.GetCurrentAnimatorStateInfo(0).IsTag("Example"))
Posted by: Guest on June-13-2021

Code answers related to "check if animation is playing unity"

Browse Popular Code Answers by Language