Navigation
API > API/Plugins > API/Plugins/GameplayAbilities > API/Plugins/GameplayAbilities/UAbilitySystemComponent
Description
Attempts to activate the ability that is passed in. This will check costs and requirements before doing so. Returns true if it thinks it activated, but it may return false positives due to failure later in activation. If bAllowRemoteActivation is true, it will remotely activate local/server abilities, if false it will only try to locally activate the ability
| Name | TryActivateAbilityByClass |
| Type | function |
| Header File | /Engine/Plugins/Runtime/GameplayAbilities/Source/GameplayAbilities/Public/AbilitySystemComponent.h |
| Include Path | #include "AbilitySystemComponent.h" |
| Source | /Engine/Plugins/Runtime/GameplayAbilities/Source/GameplayAbilities/Private/AbilitySystemComponent_Abilities.cpp |
UFUNCTION (BlueprintCallable, Category="Abilities")
bool TryActivateAbilityByClass
(
TSubclassOf < UGameplayAbility > InAbilityToActivate,
bool bAllowRemoteActivation
)