UAbilitySystemComponent::TryActivateAbility

Attempts to activate the given ability, will check costs and requirements before doing so.

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

bool TryActivateAbility
(
    FGameplayAbilitySpecHandle AbilityToActivate,
    bool bAllowRemoteActivation
)

Remarks

Attempts to activate the given ability, 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

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