When using GAS, instead of having to manually trigger, track execution and update attributes, the developers can declare abilities, tasks and effects and grant or trigger them in response to gameplay events.
More importantly the Ability System acts as a nice abstraction for managing various events and data when entities, including the player, attain, release or deploy abilities. Let's look at a simple BTTask below which executes an ability.
In the above task, we check if the pawn, which is controlled by the Behavior Tree, triggering the task is an entity configured with the ability system. If yes, it proceeds to activate that ability defined by the
Ability Class variable. Now the ability will only be executed if the entity has already been granted the same. Next we add a 2-second delay (which may or may not be required in your case) before marking the task as finished successfully.
Return Value pin on the
Try Activate Ability by Class node, we could have branched to mark execution as success only if the activation was successful as in the image below.
But the catch is
Try Activate ability by Class can return false positives and therefore it cannot be of consistent utility and we design around this limitation elsewhere in the chain and simply mark all executions as successful.
And finally, we have our new task available in the Behavior Tree context menu to utilise as desired.