I am trying to utilize GAS and I have created an ability and given it a cooldown with a 3 second duration. I am trying to get the cooldown time remaining using the blueprint node on the ability but it always returns 0. Is there something I am missing or maybe not configuring correctly? This is the show the cooldown in the UI by the way. It’s worth noting that the ability does go on cooldown. When I use the ability, I am unable to use it again until the 3 seconds is over and when debugging in the editor window it shows it correctly adding the gameplay tag.
For reference, I get the active abilities from the player loop over them and pass each ability to it’s own UI element. The above is the logic in the UI element. The Print String always returns 0 even after I press the ability
Are you intending to use a curvetable lookup for Duration Magnitude? It may be returning a 0.0 for the passed in value of 3.0. If you aren’t intending to use a curvetable, set that to none and see if it works…
Otherwise I didn’t see anything else standing out, unless possibly it’s a multiplayer networking thing. Depends on your setup.
Looking closer, that’s just how UE5 shows the curvetable picker. I’m still on 4.26 so it didn’t look the same and had assumed you were using curvetables.
Is this setup for multiplayer and maybe a networking issue? I’m not sure if it affects cooldown, as those are attached to the Ability and seem like they should start local when called, but you could try temporarily changing your repmode (normally set in your char or playerstate constructor):
to see if your repmode is keeping this info only on the server and not repping it to the client. This is a bit of a swing in the dark without combing thru the GAS source but may give some clues.
Further, maybe do a printstring or breakpoint to verify the ability itself is the actual one you’re trying to get the cooldown time from, just in case it isn’t assigning properly.
I’ve encountered the same issue, even with the ASC set to full replication. The cooldown GE is being replicated to clients, and the tags are applied, but the BP node still just returns zero. Here’s my workaround:
Use a tag query with the cooldown effect’s tag to get active effects that match, then get the duration of the effects it returns. You could do more with the output array of the Get Active Gameplay Effects if you want to be safer, like array length checking.
I use a TMap of Gameplay Ability Classes to Tag Queries in order to know which query to use for each ability. It’s not ideal, and probably much less efficient, but it works. I’m not sure if we’re using the blueprint node incorrectly or if it’s bugged.