Problem with stopping an ability with Button Down

Hi all,

So I'm having an issue with stopping an ability with Button Down. I'm starting the ability using Button Down as well, but I can't seem to get the ability to stop using Button Down. Here is the ability:

Code:
public class SomeAbility : Generic
    {
        protected override void AbilityStarted()
        {
            Debug.Log("Ability started");
        }

        protected override void AbilityStopped(bool force)
        {
            Debug.Log("Ability stopped");
        }
    }

Here are the properties in the Inspector:
Ability.jpg

If I press the key, the AbilityStarted() event gets called, but if I press the key again, AbilityStopped() is not being called. Am I missing something here? Any help would be much appreciated :)
 
For that situation your stop type should be button toggle. The button down start is preventing the button down stop from triggering.
 
For that situation your stop type should be button toggle. The button down start is preventing the button down stop from triggering.
Strangely, Button Toggle also doesn't work. The ability remains Active in the Inspector, and AbilityStopped() is still not being called. :unsure:
 
Can you try a fresh project? The speed change ability uses this setup so you can compare against that.
 
Can you try a fresh project? The speed change ability uses this setup so you can compare against that.
Same problem even within a fresh project. AbilityStarted() gets called but AbilityStopped() doesn't and the ability remains active. I've also tried reordering the abilities, but that hasn't worked either.
 
What is your goal? If I have the setup:

Start Type: Button Down
Stop Type: Button Toggle

And I set the ability to have the Jump Input Name, the ability will start when I press the spacebar once. If I then press the spacebar again then the ability will stop.
 
What is your goal? If I have the setup:

Start Type: Button Down
Stop Type: Button Toggle

And I set the ability to have the Jump Input Name, the ability will start when I press the spacebar once. If I then press the spacebar again then the ability will stop.
So I have multiple player variants and I want to be able to control which player type can access an in-game map by simply enabling or disabling the ability for that particular player type. In order to open or close the map, the M key needs to be pressed. So I assumed I could just have a Button Down to start the ability, and then a Button Down to stop the ability. But it seems that the ability simply won't stop :unsure:
 
I would only use the ability system in cases where the properties of the character need to change. For displaying a map I would not use the ability system for that since it is independent of the character. Maybe the reason it doesn't work relates to the enabling/disabling of the abilities for a particular player type.
 
I would only use the ability system in cases where the properties of the character need to change. For displaying a map I would not use the ability system for that since it is independent of the character. Maybe the reason it doesn't work relates to the enabling/disabling of the abilities for a particular player type.
I actually thought it's because of the Input System. If I set the Stop Type to Automatic and then have a condition that states that if the map is visible and the M key was pressed, then the ability can stop, what happens is as soon as the ability is started with Button Down, it automatically stops because of presumably the wasPressedThisFrame being true. But if I make the Stop Type Button Down or Toggle, then it just won't stop. I might just have to resort to manually checking for inputs inside my Map script then.
 
I would only use the ability system in cases where the properties of the character need to change. For displaying a map I would not use the ability system for that since it is independent of the character. Maybe the reason it doesn't work relates to the enabling/disabling of the abilities for a particular player type.
How would you implement a map system if you weren't using the ability system? If the player was to open a map, I assume you'd want player input into the UCC to be disabled while still being able to control the UI.
 
How would you implement a map system if you weren't using the ability system? If the player was to open a map, I assume you'd want player input into the UCC to be disabled while still being able to control the UI.
You can use the OnEnableGameplayInput event:

 
Top