[Bug] Can't use a string variable for the Ability Type shared string

Cheo

Active member
Hello, the Start Stop Ability contains an Ability Type dropdown that can be mapped to a string variable, but when writing something like "Jump" for example we get this error :

Code:
[Exception] NullReferenceException: Object reference not set to an instance of an object
StartStopAbility.OnStart() at /Behavior Designer/Integrations/UltimateCharacterController/Scripts/Tasks/StartStopAbility.cs:39
  37:  // Find the specified ability.
  38:  var abilities = m_CharacterLocomotion.GetAbilities(TaskUtility.GetTypeWithinAssembly(m_AbilityType.Value));
-->  39:  if (abilities.Length > 1) {
  40:      // If there are multiple abilities found then the priority index should be used, otherwise set the ability to the first value.
  41:      if (m_PriorityIndex.Value != -1) {

BehaviorManager.PushTask() at <4a24131e73ec49f7805f3dfb6a69fa78>:0

BehaviorManager.RunTask() at <4a24131e73ec49f7805f3dfb6a69fa78>:0

BehaviorManager.RunParentTask() at <4a24131e73ec49f7805f3dfb6a69fa78>:0

BehaviorManager.RunTask() at <4a24131e73ec49f7805f3dfb6a69fa78>:0

BehaviorManager.Tick() at <4a24131e73ec49f7805f3dfb6a69fa78>:0

BehaviorManager.Tick() at <4a24131e73ec49f7805f3dfb6a69fa78>:0

BehaviorManager.Update() at <4a24131e73ec49f7805f3dfb6a69fa78>:0

So at the moment we can't use a variable to select which ability to use, this needs to be fixed ! I'm using the latest version of BD and Unity 2023.1.3. Thanks in advance.
 
The ability requires a fully namespaced name. So Jump is Opsive.UltimateCharacterController.Character.Abilities.Jump. If you are typing it in manually you will need to use the full name.
 
Ah I see, my bad it's not a bug then ! I just tested with the full name and it works, it's a bit of a mouthful but that's okay :)
 
Top