Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Animator animator = GetComponent<Animator>();
- float time;
- RuntimeAnimatorController ac = animator.runtimeAnimatorController; //Get Animator controller
- print (ac.animationClips[0].length);
- OR
- Animator animator;
- AnimatorClipInfo[] clipInfo = animator.GetCurrentAnimatorClipInfo(0);
- float animationLength = clipInfo[0].clip.length;
Advertisement