Ride ability IndexOutOfRangeException

wuyan

Member
Hi, I followed the documentation (page 86), and added Ride ability to my new created Nolan character.Using the demo sence Blite prefab (or my new created horse). When I mount it, will get the following error. Did I missed some steps that aren't mentioned in the documentation?I have add the airborne,movetowards preset and ride IK preset. Thanks!

IndexOutOfRangeException: Index was outside the bounds of the array.
Opsive.UltimateCharacterController.Character.UltimateCharacterLocomotion.TryStopAbility (Opsive.UltimateCharacterController.Character.Abilities.Ability ability, System.Boolean force) (at Assets/Opsive/UltimateCharacterController/Scripts/Character/UltimateCharacterLocomotion.cs:1455)
Opsive.UltimateCharacterController.Character.UltimateCharacterLocomotion.TryStartAbility (Opsive.UltimateCharacterController.Character.Abilities.Ability ability, System.Boolean ignorePriority, System.Boolean ignoreCanStartCheck) (at Assets/Opsive/UltimateCharacterController/Scripts/Character/UltimateCharacterLocomotion.cs:1111)
Opsive.UltimateCharacterController.Character.UltimateCharacterLocomotion.TryStartAbility (Opsive.UltimateCharacterController.Character.Abilities.Ability ability, System.Boolean ignorePriority) (at Assets/Opsive/UltimateCharacterController/Scripts/Character/UltimateCharacterLocomotion.cs:1065)
Opsive.UltimateCharacterController.Character.UltimateCharacterLocomotion.TryStartAbility (Opsive.UltimateCharacterController.Character.Abilities.Ability ability) (at Assets/Opsive/UltimateCharacterController/Scripts/Character/UltimateCharacterLocomotion.cs:1054)
Opsive.UltimateCharacterController.Character.UltimateCharacterLocomotion.UpdateAbilities (Opsive.UltimateCharacterController.Character.Abilities.Ability[] abilities) (at Assets/Opsive/UltimateCharacterController/Scripts/Character/UltimateCharacterLocomotion.cs:783)
Opsive.UltimateCharacterController.Character.UltimateCharacterLocomotion.UpdateUltimateLocomotion () (at Assets/Opsive/UltimateCharacterController/Scripts/Character/UltimateCharacterLocomotion.cs:724)
Opsive.UltimateCharacterController.Character.CharacterLocomotion.Move (System.Single horizontalMovement, System.Single forwardMovement, System.Single deltaYawRotation) (at Assets/Opsive/UltimateCharacterController/Scripts/Character/CharacterLocomotion.cs:477)
Opsive.UltimateCharacterController.Game.KinematicObjectManager+KinematicCharacter.Move (System.Boolean manualMove) (at Assets/Opsive/UltimateCharacterController/Scripts/Game/KinematicObjectManager.cs:237)
Opsive.UltimateCharacterController.Game.KinematicObjectManager.CharacterMoveInternal (System.Int32 characterIndex) (at Assets/Opsive/UltimateCharacterController/Scripts/Game/KinematicObjectManager.cs:931)
Opsive.UltimateCharacterController.Game.KinematicObjectManager.CharacterMove (System.Int32 characterIndex) (at Assets/Opsive/UltimateCharacterController/Scripts/Game/KinematicObjectManager.cs:914)
Opsive.UltimateCharacterController.Character.Abilities.Rideable.LateUpdate () (at Assets/Opsive/UltimateCharacterController/Scripts/Character/Abilities/Rideable.cs:141)
Opsive.UltimateCharacterController.Character.UltimateCharacterLocomotion.LateUpdateActiveAbilities (Opsive.UltimateCharacterController.Character.Abilities.Ability[] abilities, System.Int32& abilityCount) (at Assets/Opsive/UltimateCharacterController/Scripts/Character/UltimateCharacterLocomotion.cs:1042)
Opsive.UltimateCharacterController.Character.UltimateCharacterLocomotion.LateUpdateUltimateLocomotion () (at Assets/Opsive/UltimateCharacterController/Scripts/Character/UltimateCharacterLocomotion.cs:1027)
Opsive.UltimateCharacterController.Character.UltimateCharacterLocomotion.UpdatePositionAndRotation () (at Assets/Opsive/UltimateCharacterController/Scripts/Character/UltimateCharacterLocomotion.cs:843)
Opsive.UltimateCharacterController.Character.CharacterLocomotion.UpdatePositionAndRotation (System.Boolean fromAnimatorMove) (at Assets/Opsive/UltimateCharacterController/Scripts/Character/CharacterLocomotion.cs:517)
Opsive.UltimateCharacterController.Character.CharacterLocomotion.OnAnimatorMove () (at Assets/Opsive/UltimateCharacterController/Scripts/Character/CharacterLocomotion.cs:1453)
Opsive.UltimateCharacterController.Character.UltimateCharacterLocomotion.OnAnimatorMove () (at Assets/Opsive/UltimateCharacterController/Scripts/Character/UltimateCharacterLocomotion.cs:1772)
 
What ability is it trying to stop? Can you insert a breakpoint to determine why the index is out of range?
 
What ability is it trying to stop? Can you insert a breakpoint to determine why the index is out of range?
Stop the ride ability.

Characters can't ride on horseback now. Every time when try to mount, the character steps on the stirrup, tries to climb up the horse's back, but slides down or over the horse's back. At this time, will stop ride ability. Because I used the default dismount event option, duration instead of event. so it will continue to stop ride ability, resulting in the above error. I have used the MoveTowards Preset, Airborne Preset and Moving Preset of the demo.

When I switched to event, I realized that the character couldn't get on the horse at all. I can use demo scene Nolan to complete ride. But my new created Nolan can't. So I should have missed some steps. But which?

Besides, I would like to ask which abilities do ride ability depend on, which abilities do I have to add to the character?
 
But my new created Nolan can't. So I should have missed some steps. But which?
Are you mounting on the same rideable object? If the new character isn't able to mount on the same rideable object then I would check your Ride ability since this should be the only thing that affects if the character can mount. Make sure the Ride ability has a higher priority.

Besides, I would like to ask which abilities do ride ability depend on, which abilities do I have to add to the character?
Ride interacts with the Ridable ability on the Rideable object, but other than that it doesn't depend on anything. It will use MoveTowards if the ability exists on the character.
 
Are you mounting on the same rideable object? If the new character isn't able to mount on the same rideable object then I would check your Ride ability since this should be the only thing that affects if the character can mount. Make sure the Ride ability has a higher priority.


Ride interacts with the Ridable ability on the Rideable object, but other than that it doesn't depend on anything. It will use MoveTowards if the ability exists on the character.
Hi Justin, Thank you!!!

The priority should be haigher than fall ability. Sorry, I did the comparisons one by one, but missed here. :)
 
Besides, need to add AllowEquippedItemsRidePreset in demo for ride ability, otherwise will can't equip weapons when riding.
 
Top