Hello!
I am trying to understand how to get the length of current playing clip in Animator.
I use AnimatorStateInfo and get information about clip playing in current State.
But I don’t understand why following code return the same result in different three cases?
AnimatorStateInfo clipInfo;
clipInfo = animator.GetCurrentAnimatorStateInfo(0);
Debug.Log("walk1"+clipInfo.length+" "+clipInfo.loop);
animator.Play("attack1");
clipInfo = animator.GetCurrentAnimatorStateInfo(0);
Debug.Log("attack1"+clipInfo.length+" "+clipInfo.loop);
animator.Play("attack2");
clipInfo = animator.GetCurrentAnimatorStateInfo(0);
Debug.Log("attack2"+clipInfo.length+" "+clipInfo.loop);
State “walk1” have already been worked before this code. And I get length of clip witch is in state “walk1” in all this three cases.