This question was
closed Oct 03, 2016 at 09:45 PM by
TBruce for the following reason:
The question is answered, right answer was accepted
Question by
msiqueroli · Aug 25, 2015 at 06:57 PM ·
animatortimeclip
How to get current time of an Animator?
I need to store the current time of an animator.
Comment
Answer by msiqueroli · Aug 26, 2015 at 01:18 PM
I found the solution:
Animator myAnimator = GameObject.Find("dadoAnimado").GetComponent<Animator>();
AnimatorStateInfo animationState = myAnimator.GetCurrentAnimatorStateInfo(0);
AnimatorClipInfo[] myAnimatorClip = myAnimator.GetCurrentAnimatorClipInfo(0);
float myTime = myAnimatorClip[0].clip.length * animationState.normalizedTime;
Follow this Question
Related Questions
Animation clip doesn't play 1 Answer
How to play and hold on a single frame of an animator clip 1 Answer
how to restart mecanim state animation or play it from random position [SOLVED] 0 Answers
Why is my animation being started, but is not actually playing? 1 Answer
Syncing Animations both playing from Seperate Animators 0 Answers