Getting index out of range for Footsteps

reisnersteve

New member
Hey!

I recently set up the character controller. But footsteps don't want to work. I am clearly doing something wrong. This is the error I get:
Code:
ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
System.Collections.Generic.List`1[T].get_Item (System.Int32 index) (at <ed969b0e627d471da4848289f9c322df>:0)
Opsive.UltimateCharacterController.Character.CharacterFootEffects.GroupFootStep () (at ./Packages/com.opsive.ultimatecharactercontroller/Runtime/Character/CharacterFootEffects.cs:413)
Opsive.UltimateCharacterController.Character.CharacterFootEffects.DetectCameraBob () (at ./Packages/com.opsive.ultimatecharactercontroller/Runtime/Character/CharacterFootEffects.cs:401)
Opsive.UltimateCharacterController.Character.CharacterFootEffects.FixedUpdate () (at ./Packages/com.opsive.ultimatecharactercontroller/Runtime/Character/CharacterFootEffects.cs:344)

When changing the footstep mode to fixed interval the same thing happens:
Code:
ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
System.Collections.Generic.List`1[T].get_Item (System.Int32 index) (at <ed969b0e627d471da4848289f9c322df>:0)
Opsive.UltimateCharacterController.Character.CharacterFootEffects.GroupFootStep () (at ./Packages/com.opsive.ultimatecharactercontroller/Runtime/Character/CharacterFootEffects.cs:413)
Opsive.UltimateCharacterController.Character.CharacterFootEffects.UpdateFixedInterval () (at ./Packages/com.opsive.ultimatecharactercontroller/Runtime/Character/CharacterFootEffects.cs:388)
Opsive.UltimateCharacterController.Character.CharacterFootEffects.FixedUpdate () (at ./Packages/com.opsive.ultimatecharactercontroller/Runtime/Character/CharacterFootEffects.cs:341)

What am I doing wrong?
 
Is your character a humanoid? If it's a generic character you should specify the feet within the Character Foot Effects component under the Feet foldout.
 
That will be the reason for the error. When creating the character it said that it is not humanoid, although it is. Where does that get determined? And how would I change that?
 
The character is set to humanoid and has a head bone. See attached screenshot. The character manager still says it is not.
 

Attachments

  • 1738532588258.png
    1738532588258.png
    47.2 KB · Views: 2
  • Screenshot 2025-02-02 224501.png
    Screenshot 2025-02-02 224501.png
    297.5 KB · Views: 2
Hmm, can you insert a breakpoint or Debug.Log within CharacterManager.IsValidHumanoid to determine what part is returning false?
 
Turns out, if you don't add the head bone as an extra transform to expose, CharacterManager.IsValidHumanoid will return false, even if the model has a head bone. Adding a screenshot so if someone has the same problem in the future they can see where you have to do that.
 

Attachments

  • 1738606240046.png
    1738606240046.png
    95.7 KB · Views: 3
Back
Top