A.I Use Ability

Frocha

Member
I tried making a simple script for the the A.I to use whatever ability is at the top of the list. I get this error. Its an action I created in Behavior Designer.
NullReferenceException: Object reference not set to an instance of an object
Opsive.UltimateCharacterController.Character.Abilities.HeightChange.AbilityStarted () (at Assets/Opsive/UltimateCharacterController/Scripts/Character/Abilities/HeightChange.cs:89)
Opsive.UltimateCharacterController.Character.Abilities.Ability.StartAbility (System.Int32 index) (at Assets/Opsive/UltimateCharacterController/Scripts/Character/Abilities/Ability.cs:466)
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:1181)
 
Are you getting any errors before that? If you insert a breakpoint is m_CharacterLocomotion the null variable or m_CapsuleColliderHeight?
 
How many colliders does your character start with? Within Start it should initialize the m_CapsuleColliderHeight array.
 
Im sorry im not sure what to look for. I just want the A.I to use the ability after finding cover. This is a bit frustrating.
 
Last edited:
I edited the A.I characters capsule collider and reduced the radius and height. So now he uses the ability, but i still get the error. Is the capsule collider causing this?
*edit I restarted Unity and the A.i wont crouch again. I feel like it has something to do with the collider. But all ive done to it is resize it. I cant think of anything else that affects it.
 
Last edited:
Top