Question by
am_GA · Feb 19, 2019 at 05:29 PM ·
mechanimindexoutofrangeexception
GetNextAnimatorClipInfo throws IndexOutOfRangeException
I have animations loaded via asset bundles. I can do the following with no issue:
animatedGameObject.GetComponent<Animator>().GetCurrentAnimatorClipInfo(0)[0].clip.name
But the following throw an error:
animatedGameObject.GetComponent<Animator>().GetNextAnimatorClipInfo(0)[0].clip.name;
animatedGameObject.GetComponent<Animator>().GetNextAnimatorClipInfo(0)[0].ToString();
Error:
IndexOutOfRangeException: Array index is out of range.
animatedGameObject.GetComponent<Animator>().GetNextAnimatorClipInfo(0).Length
returns 0
Why doesn't the next clip exist? Is it because of asset bundling? How can I access it? Thanks in advance.
Comment
Also any other methods of getting the name of the next clip in an animation controller are more than welcome.