The error shows up after running the game 2 min.
ArgumentOutOfRangeException: Argument is out of range.
Parameter name: index
System.Collections.Generic.List`1[UnityEngine.Animator].get_Item (Int32 index) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/List.cs:633)
RobotAI.RobotBodyPartAnimationTurnOn () (at Assets/BattleMap/RobotAI.cs:727)
CAT001EnterIdle.OnStateEnter (UnityEngine.Animator animator, AnimatorStateInfo stateInfo, Int32 layerIndex) (at Assets/Behaviour/CAT001EnterIdle.cs:16)
public class CAT001EnterIdle: StateMachineBehaviour {
// OnStateEnter is called when a transition starts and the state machine starts to evaluate this state
override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) {
// CAT enter idle mode
// trigger robotbody part animation
animator.GetComponent<RobotAI>().RobotBodyPartAnimationTurnOn();
}
}
public void RobotBodyPartAnimationTurnOn()
{
if (weaponAnimator[weaponSelected] != null)
weaponAnimator[weaponSelected].SetTrigger(weapon[weaponSelected].RBPAnimeTrigger);
}