- Home /
Get length from state in Animator
Hi, how can i get seconds from one state of Animator? I want to know length of "Take 001" state?
How can i do it?
Thanks
http://docs.unity3d.com/ScriptReference/Animator-recorderStopTime.html
http://docs.unity3d.com/ScriptReference/Animator-recorderStartTime.html
You can use that if you're IN the Take 001 state.
Alternatively,
http://docs.unity3d.com/ScriptReference/AnimationState-length.html
Answer by Raynoko · Feb 02, 2015 at 11:22 AM
i found solution with thi source code:
AnimatorStateInfo currInfo = animator.GetCurrentAnimatorStateInfo(0);
Debug.Log(currInfo.normalizedTime);
Please check this answer : http://answers.unity3d.com/questions/692593/get-animation-clip-length-using-animator.html
i was trying this, but in Unity5 doesnt work it. I dont know, but still some errors.
or what i need is normalizedTime from this state. but this doesnt work too.
Your answer
Follow this Question
Related Questions
Animator.GetCurrentAnimatorStateInfo(0).IsName("FallOffBed") unexpectedly returns false 0 Answers
State weight inside StateMachineBehaviour 0 Answers
audio.clip.length 'hides' my button! yaiks! 1 Answer
Change parameters 0 Answers
Is it possible that animations are breaking the Animator interface? 0 Answers