Hello Unreal friends!
I hope there is someone who is fluid in the Gameplay Ability System who can help me out.
I have two Abilities: one with 1 second cooldown and one with a 5 second cooldown.
I would like to implement a global cooldown of 1 second, so you cant cast both spells instantly one after onather.
But you can just add one Cooldown Effect to a spell, or?
Is their anything that comes with GAS to implement this?
One solution is to grant a new GE with the 1 sec CD when you go in CD in yours abiliies.
Then put the 1 sec CD tag as “blocking tag” for the 2 abilities. So you won’t be able to activate them if this tag is present.
You are now done with your Gameplay Effect now let’s move on to using this for an ability. Now I don’t know of a better way of doing this, so every ability you will have to add this if you want it to be on the GCD.
Add an “ApplyGameplayEffectToOwner” node right after the “Event ActivateAbility” node and set it to make it look like the image below with the “Gameplay Effect Class” input set to your global cooldown GE:
Finally, in the gameplay ability, go to the Tags → ActivationBlockedTags and add the Ability.GlobalCooldown tag. Now when you use that ability, the player will have the tag added to them for the duration of the GE you made and it will be auto removed once the duration is over, thus allowing the player to click the ability again.
One thing that I have not figured out yet is how to show this cooldown in the UI - still working on that one!