UAbilitySystemComponent::GetActivatableGameplayAbilitySpecsByAllMatchingTags

Gets all Activatable Gameplay Abilities that match all tags in GameplayTagContainer AND for which DoesAbilitySatisfyTagRequirements() is true.

Windows
MacOS
Linux

References

Module

GameplayAbilities

Header

/Engine/Plugins/Runtime/GameplayAbilities/Source/GameplayAbilities/Public/AbilitySystemComponent.h

Include

#include "AbilitySystemComponent.h"

Source

/Engine/Plugins/Runtime/GameplayAbilities/Source/GameplayAbilities/Private/AbilitySystemComponent_Abilities.cpp

Syntax

void GetActivatableGameplayAbilitySpecsByAllMatchingTags
(
    const FGameplayTagContainer & GameplayTagContainer,
    TArray< struct FGameplayAbilitySpec * > & MatchingGameplayAbilities,
    bool bOnlyAbilitiesThatSatisfyTagRequirements
) const

Remarks

Gets all Activatable Gameplay Abilities that match all tags in GameplayTagContainer AND for which DoesAbilitySatisfyTagRequirements() is true. The latter requirement allows this function to find the correct ability without requiring advanced knowledge. For example, if there are two "Melee" abilities, one of which requires a weapon and one of which requires being unarmed, then those abilities can use Blocking and Required tags to determine when they can fire. Using the Satisfying Tags requirements simplifies a lot of usage cases. For example, Behavior Trees can use various decorators to test an ability fetched using this mechanism as well as the Task to execute the ability without needing to know that there even is more than one such ability.

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss