Has anyone seen this error before: IndexOutOfRangeException: Array index is out of range. UnityEditorInternal....

Has anyone seen this error before: IndexOutOfRangeException: Array index is out of range. UnityEditorInternal.AnimationWindowUtility.AddClipToAnimatorComponent (UnityEngine.Animator animator, UnityEngine.AnimationClip newClip) (at /Users/builduser/buildslave/unity/build/Editor/Mono/Animation/AnimationWindow/AnimationWindowUtility.cs:536) UnityEditorInternal.AnimationWindowUtility.AddClipToAnimationPlayerComponent (UnityEngine.Component animationPlayer, UnityEngine.AnimationClip newClip) (at /Users/builduser/buildslave/unity/build/Editor/Mono/Animation/AnimationWindow/AnimationWindowUtility.cs:516) ?

This happens when I try to create an animation on a flap of a sterile gloves package that I made in Blender. The only examples I found of the IndexOutOfRangeException were on peoples scripts but mine is on a internal animation script in the Unity 5 engine… or so it appears. If anyone has any tips or need more info from me please ask because I really need this flap to rotate open…

Hmm, the only thing i’ve found in the AddClipToAnimatorComponent method that could possible throw this error is this line

ChildAnimatorState childAnimatorState = animatorController.layers[0].stateMachine.FindState(newClip.name);

It simply gets the first layer on the animatorController, however it seems your layers array is empty. Your Animator statemachine should have at least one layer.

Thanks to both of you for trying and sorry for the super delayed solve response… We’re trying to convert to WebGL (helps us all.) Updating Unity solved the issue so the world may never know.