Ability Stopping

The Highway Man

New member
1. Ultimate Character Controller

2 Unity 2019.2.2

3. I believe I may have found a bug in UCC, when I use the DetectObjectAbilityBase Class with Start Type : Automatic and Stop Type : Automatic, It appears that other Abilities are not able to start when using Start Type : ButtonDown. The bug does not show when the DetectObjectAbilityBase class returns false for CanStartAbillity(). I tracked down the bug to the CanInputStartAbility() and I believe it has something it do with the m_ButtonUp array not having a right value for some reason. I have tried every quick trick I could think of such as making the ability using DetectObjectAbilityBase the last in the index of abilities and using IsConcurrent overridden to true, but to no avail. Right now the only workaround is using Start Type : Button Down Continuous for all my other manually starting Abilities.

4. To reproduce create a new class the inherits from DetectObjectAbilityBase and with Start Type : Automatic and Stop Type : Automatic. Set the rest of the abilities for the character to Start Type : ButtonDown. Now none of them will start. (sometimes will with repeatedly hitting the button )

5. no error message.
 
I would check the priority of your ability - if your new ability is towards the top then it is going to have priority over all other priorities. Depending on which detection method you are using the ability is likely to keep starting which will prevent other abilities from starting. I tested this by setting Vault from the agility pack to automatic and other abilities were able to start.
 
Wow, thank you the quick response. I have the ability giving me trouble at the bottom of the list of Character Abilities.

The ability right now is just a class with the DetectObjectAbilityBase as its base, that highlights the m_DetectedObject GameObject.

For some reason the CanInputStartAbility() will return false when called by line 127 of the UltimateCharacterLocomotionHandler.cs. With DetectObjectAbilityBase starting and stopping the same frame.
 
With an empty DetectObjectAbilityBase class I wouldn't have the stop type set to automatic. With no real start or stop condition it's going to just keep flipping between starting and stopping which is going to cause confusion. To get started I would have a start type of Automatic, but then set the stop type to Manual. This will give you control within the ability to specifically stop the ability with the StopAbility method.

Within the demo scene you can test an existing ability by using the Interact ability - this ability inherits DetectObjectAbilityBase. If you set one of the Interact abilities you'll see that you can still jump, for example.
 
Wow, I’ve been fighting this issue for about a week now, and of course I figure it out right after starting a thread. It was StopAbility(). I had it in the AbilityStarted() after my code for highlighting, as a way to make sure the ability would end every frame. I though I had checked this before, to see if this was the cause of the problem.

Thanks Justin, for your quick response.
 
Top