UGameplayAbility

Abilities define custom gameplay logic that can be activated by players or external game logic

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

GameplayAbilities

Header

/Engine/Plugins/Runtime/GameplayAbilities/Source/GameplayAbilities/Public/Abilities/GameplayAbility.h

Include

#include "Abilities/GameplayAbility.h"

Syntax

[UCLASS](Programming/UnrealArchitecture/Reference/Classes#classdeclaration)(Blueprintable)
class UGameplayAbility :
    public UObject ,
    public IGameplayTaskOwnerInterface

Remarks

Abilities define custom gameplay logic that can be activated by players or external game logic

Variables

Name Description

Public variable UProperty Category, EditDefaultsOnly, Meta

FGameplayTagCon ...

 

AbilityTags

Public variables, exposed for backwards compatibility

This ability has these tags

Protected variable UProperty Category, EditDefaultsOnly

TArray < FAbilit ...

 

AbilityTriggers

Triggers to determine if this ability should execute in response to an event

Protected variable UProperty Category, EditDefaultsOnly, Meta

FGameplayTagCon ...

 

ActivationBlockedTags

This ability is blocked if the activating actor/component has any of these tags

Protected variable UProperty Category, EditDefaultsOnly, Meta

FGameplayTagCon ...

 

ActivationOwnedTags

Tags to apply to activating owner while this ability is active

Protected variable UProperty Category, EditDefaultsOnly, Meta

FGameplayTagCon ...

 

ActivationRequiredTags

This ability can only be activated if the activating actor/component has all of these tags

Protected variable UProperty

TArray < UGamepl ...

 

ActiveTasks

List of currently active tasks, do not modify directly

Protected variable

bool

 

bHasBlueprintActivate

Protected variable

bool

 

bHasBlueprintActivateFromEvent

Protected variable

bool

 

bHasBlueprintCanUse

Protected variable

bool

 

bHasBlueprintShouldAbilityRespondToEvent

Protected variable UProperty

bool

 

bIsActive

True if the ability is currently active. For instance per owner abilities

Protected variable UProperty

bool

 

bIsBlockingOtherAbilities

True if the ability block flags are currently enabled

Protected variable UProperty

bool

 

bIsCancelable

True if the ability is currently cancelable, if not will only be canceled by hard EndAbility calls

Protected variable UProperty Category, EditDefaultsOnly, Meta

FGameplayTagCon ...

 

BlockAbilitiesWithTag

Abilities with these tags are blocked while this ability is active

Protected variable UProperty Category BlueprintReadOnly

bool

 

bMarkPendingKillOnAbilityEnd

Flag that is set by AbilitySystemComponent::OnRemoveAbility to indicate the ability needs to be cleaned up in AbilitySystemComponent::NotifyAbilityEnded

Public variable UProperty Category, EditDefaultsOnly

bool

 

bReplicateInputDirectly

If true, this ability will always replicate input press/release events to the server.

Protected variable UProperty Category, EditDefaultsOnly

bool

 

bRetriggerInstancedAbility

If true, and trying to activate an already active instanced ability, end it and re-trigger it.

Protected variable UProperty Category, EditDefaultsOnly

bool

 

bServerRespectsRemoteAbilityCancellation

If this is set, the server-side version of the ability can be canceled by the client-side version.

Protected variable UProperty Category, EditDefaultsOnly, Meta

FGameplayTagCon ...

 

CancelAbilitiesWithTag

Ability exclusion / canceling

Protected variable

TArray < FName >

 

CancelTaskInstanceNames

Protected variable UProperty Category, EditDefaultsOnly

TSubclassOf < cl...

 

CooldownGameplayEffectClass

This GameplayEffect represents the cooldown.

Protected variable UProperty Category, EditDefaultsOnly

TSubclassOf < cl...

 

CostGameplayEffectClass

This GameplayEffect represents the cost (mana, stamina, etc) of the ability.

Protected variable UProperty Category BlueprintReadOnly

FGameplayAbilit ...

 

CurrentActivationInfo

This is information specific to this instance of the ability.

Protected variable

const FGameplay ...

 

CurrentActorInfo

This is shared, cached information about the thing using us E.g, Actor*, MovementComponent*, AnimInstance, etc.

Protected variable UProperty Category BlueprintReadOnly

FGameplayEventD ...

 

CurrentEventData

Information specific to this instance of the ability, if it was activated by an event

Protected variable UProperty

UAnimMontage &#...

 

CurrentMontage

Active montage being played by this ability

Protected variable

FGameplayAbilit ...

 

CurrentSpecHandle

For instanced abilities

Protected variable

TArray < FName >

 

EndTaskInstanceNames

Protected variable UProperty Category, EditDefaultsOnly

TEnumAsByte < EG ...

 

InstancingPolicy

How the ability is instanced when executed.

Protected variable UProperty Category, EditDefaultsOnly

TEnumAsByte < EG ...

 

NetExecutionPolicy

How does an ability execute on the network.

Protected variable UProperty Category, EditDefaultsOnly

TEnumAsByte < EG ...

 

NetSecurityPolicy

What protections does this ability have? Should the client be allowed to request changes to the execution of the ability?

Public variable

FGenericAbility ...

 

OnConfirmDelegate

Callback for when this ability has been confirmed by the server

Public variable

FOnGameplayAbil ...

 

OnGameplayAbilityCancelled

Notification that the ability is being cancelled. Called before OnGameplayAbilityEnded.

Public variable

FOnGameplayAbil ...

 

OnGameplayAbilityEnded

Notification that the ability has ended. Set using TryActivateAbility.

Public variable

FGameplayAbilit ...

 

OnGameplayAbilityEndedWithData

Notification that the ability has ended with data on how it was ended

Public variable

FOnGameplayAbil ...

 

OnGameplayAbilityStateEnded

Used by the ability state task to handle when a state is ended

Public variable UProperty

bool

 

RemoteInstanceEnded

Set when the remote instance of this ability has ended (but the local instance may still be running or finishing up

Protected variable UProperty Category, EditDefaultsOnly

TEnumAsByte < EG ...

 

ReplicationPolicy

Protected properties

Protected variable

int8

 

ScopeLockCount

A count of all the current scope locks.

Protected variable UProperty Category, EditDefaultsOnly, Meta

FGameplayTagCon ...

 

SourceBlockedTags

This ability is blocked if the source actor/component has any of these tags

Protected variable UProperty Category, EditDefaultsOnly, Meta

FGameplayTagCon ...

 

SourceRequiredTags

This ability can only be activated if the source actor/component has all of these tags

Protected variable UProperty Category, EditDefaultsOnly, Meta

FGameplayTagCon ...

 

TargetBlockedTags

This ability is blocked if the target actor/component has any of these tags

Protected variable UProperty Category, EditDefaultsOnly, Meta

FGameplayTagCon ...

 

TargetRequiredTags

This ability can only be activated if the target actor/component has all of these tags

Protected variable

TArray < FAbilit ...

 

TaskDebugMessages

Tasks can emit debug messages throughout their life for debugging purposes.

Protected variable

TSet < FGameplay ...

 

TrackedGameplayCues

GameplayCues that were added during this ability that will get automatically removed when it ends

Protected variable

TArray < FPostLo ...

 

WaitingToExecute

A list of all the functions waiting for the scope lock to end so they can run.

Constructors

Name Description

Public function

UGameplayAbility

(
    const FObjectInitializer & ObjectIn...
)

Functions

Name Description

Protected function Virtual

void

 

ActivateAbility

(
    const FGameplayAbilitySpecHandle Ha...,
    const FGameplayAbilityActorInfo ...,
    const FGameplayAbilityActivationInf ...,
    const FGameplayEventData * Trig...
)

Actually activate ability, do not call this directly

Public function

void

 

AddAbilityTaskDebugMessage

(
    UGameplayTask * AbilityTask,
    FString DebugMessage
)

Adds a debug message to display to the user

Public function Virtual Const

void

 

ApplyAbilityTagsToGameplayEffectSpec

(
    FGameplayEffectSpec & Spec,
    FGameplayAbilitySpec * AbilityS...
)

Add the Ability's tags to the given GameplayEffectSpec.

Public function Virtual Const

void

 

ApplyCooldown

(
    const FGameplayAbilitySpecHandle Ha...,
    const FGameplayAbilityActorInfo ...,
    const FGameplayAbilityActivationInf ...
)

Applies CooldownGameplayEffect to the target

Public function Virtual Const

void

 

ApplyCost

(
    const FGameplayAbilitySpecHandle Ha...,
    const FGameplayAbilityActorInfo ...,
    const FGameplayAbilityActivationInf ...
)

Applies the ability's cost to the target

Protected function Const

FActiveGamep ...

 

ApplyGameplayEffectSpecToOwner

(
    const FGameplayAbilitySpecHandle Ab...,
    const FGameplayAbilityActorInfo ...,
    const FGameplayAbilityActivationInf ...,
    const FGameplayEffectSpecHandle Spe...
)

Protected function Const

TArray < FAct ...

 

ApplyGameplayEffectSpecToTarget

(
    const FGameplayAbilitySpecHandle Ab...,
    const FGameplayAbilityActorInfo ...,
    const FGameplayAbilityActivationInf ...,
    const FGameplayEffectSpecHandle Spe...,
    const FGameplayAbilityTargetDataHan ...
)

Protected function Const

FActiveGamep ...

 

ApplyGameplayEffectToOwner

(
    const FGameplayAbilitySpecHandle Ha...,
    const FGameplayAbilityActorInfo ...,
    const FGameplayAbilityActivationInf ...,
    const UGameplayEffect * Gamepla...,
    float GameplayEffectLevel,
    int32 Stacks
)

Non blueprintcallable, safe to call on CDO/NonInstance abilities

Protected function Const

TArray < FAct ...

 

ApplyGameplayEffectToTarget

(
    const FGameplayAbilitySpecHandle Ha...,
    const FGameplayAbilityActorInfo ...,
    const FGameplayAbilityActivationInf ...,
    const FGameplayAbilityTargetDataHan ...,
    TSubclassOf < UGameplayEffect > Game...,
    float GameplayEffectLevel,
    int32 Stacks
)

Non blueprintcallable, safe to call on CDO/NonInstance abilities

Protected function UFunction BlueprintCallable, Category, Meta displayname

FActiveGamep ...

 

BP_ApplyGameplayEffectToOwner

(
    TSubclassOf < UGameplayEffect > Game...,
    int32 GameplayEffectLevel,
    int32 Stacks
)

Apply Gameplay effects to Self

Apply a gameplay effect to the owner of this ability

Protected function UFunction BlueprintCallable, Category, Meta displayname

TArray < FAct ...

 

BP_ApplyGameplayEffectToTarget

(
    FGameplayAbilityTargetDataHandle Ta...,
    TSubclassOf < UGameplayEffect > Game...,
    int32 GameplayEffectLevel,
    int32 Stacks
)

Apply Gameplay effects to Target

Apply a gameplay effect to a Target

Protected function UFunction BlueprintCallable, Category, Meta displayname

void

 

BP_RemoveGameplayEffectFromOwnerWithAssetTags

(
    FGameplayTagContainer WithAssetTags,
    int32 StacksToRemove
)

Remove Gameplay effects from Self

Protected function UFunction BlueprintCallable, Category, Meta displayname

void

 

BP_RemoveGameplayEffectFromOwnerWithGrantedTags

(
    FGameplayTagContainer WithGrantedTa...,
    int32 StacksToRemove
)

Removes GameplayEffects from owner which grant the given tags

Protected function UFunction BlueprintCallable, Category, Meta displayname

void

 

BP_RemoveGameplayEffectFromOwnerWithHandle

(
    FActiveGameplayEffectHandle Handle,
    int32 StacksToRemove
)

Removes GameplayEffect from owner that match the given handle

Protected function

void

 

CallActivateAbility

(
    const FGameplayAbilitySpecHandle Ha...,
    const FGameplayAbilityActorInfo ...,
    const FGameplayAbilityActivationInf ...,
    FOnGameplayAbilityEnded::FDelegate ...,
    const FGameplayEventData * Trig...
)

Executes PreActivate and ActivateAbility

Public function Virtual Const

bool

 

CanActivateAbility

(
    const FGameplayAbilitySpecHandle Ha...,
    const FGameplayAbilityActorInfo ...,
    const FGameplayTagContainer * S...,
    const FGameplayTagContainer * T...,
    OUTFGameplayTagContainer * Opti...
)

CanActivateAbility

Returns true if this ability can be activated right now. Has no side effects

Public function Virtual Const

bool

 

CanBeCanceled()

Returns true if this ability can be canceled

Public function Virtual

void

 

CancelAbility

(
    const FGameplayAbilitySpecHandle Ha...,
    const FGameplayAbilityActorInfo ...,
    const FGameplayAbilityActivationInf ...,
    bool bReplicateCancelAbility
)

CancelAbility

Protected function UFunction BlueprintCallable, Category

void

 

CancelTaskByInstanceName

(
    FName InstanceName
)

Add any task with this instance name to a list to be canceled (not ended) next frame.

Public function Virtual Const

bool

 

CheckCooldown

(
    const FGameplayAbilitySpecHandle Ha...,
    const FGameplayAbilityActorInfo ...,
    OUTFGameplayTagContainer * Opti...
)

Checks cooldown. returns true if we can be used again. False if not

Public function Virtual Const

bool

 

CheckCost

(
    const FGameplayAbilitySpecHandle Ha...,
    const FGameplayAbilityActorInfo ...,
    OUTFGameplayTagContainer * Opti...
)

Checks cost. returns true if we can pay for the ability. False if not

Public function Virtual

bool

 

CommitAbility

(
    const FGameplayAbilitySpecHandle Ha...,
    const FGameplayAbilityActorInfo ...,
    const FGameplayAbilityActivationInf ...,
    OUTFGameplayTagContainer * Opti...
)

Public function Virtual

bool

 

CommitAbilityCooldown

(
    const FGameplayAbilitySpecHandle Ha...,
    const FGameplayAbilityActorInfo ...,
    const FGameplayAbilityActivationInf ...,
    const bool ForceCooldown,
    OUTFGameplayTagContainer * Opti...
)

Public function Virtual

bool

 

CommitAbilityCost

(
    const FGameplayAbilitySpecHandle Ha...,
    const FGameplayAbilityActorInfo ...,
    const FGameplayAbilityActivationInf ...,
    OUTFGameplayTagContainer * Opti...
)

Public function Virtual

bool

 

CommitCheck

(
    const FGameplayAbilitySpecHandle Ha...,
    const FGameplayAbilityActorInfo ...,
    const FGameplayAbilityActivationInf ...,
    OUTFGameplayTagContainer * Opti...
)

The last chance to fail before committing, this will usually be the same as CanActivateAbility.

Public function Virtual

void

 

CommitExecute

(
    const FGameplayAbilitySpecHandle Ha...,
    const FGameplayAbilityActorInfo ...,
    const FGameplayAbilityActivationInf ...
)

Does the commit atomically (consume resources, do cooldowns, etc)

Protected function Virtual

void

 

ConfirmActivateSucceed()

Called on a predictive ability when the server confirms its execution

Protected function UFunction BlueprintCallable, Category

void

 

ConfirmTaskByInstanceName

(
    FName InstanceName,
    bool bEndTask
)

Ability Tasks

Protected function Const

void

 

DecrementListLock()

Decreases the scope lock count. Runs the waiting to execute delegates if the count drops to zero.

Public function Virtual Const

bool

 

DoesAbilitySatisfyTagRequirements

(
    const UAbilitySystemComponent & Abi...,
    const FGameplayTagContainer * S...,
    const FGameplayTagContainer * T...,
    OUTFGameplayTagContainer * Opti...
)

Returns true if none of the ability's tags are blocked and if it doesn't have a "Blocking" tag and has all "Required" tags.

Protected function Virtual

void

 

EndAbility

(
    const FGameplayAbilitySpecHandle Ha...,
    const FGameplayAbilityActorInfo ...,
    const FGameplayAbilityActivationInf ...,
    bool bReplicateEndAbility,
    bool bWasCancelled
)

Native function, called if an ability ends normally or abnormally.

Protected function UFunction BlueprintCallable, Category

void

 

EndAbilityState

(
    FName OptionalStateNameToEnd
)

Ends any active ability state task with the given name.

Protected function

void

 

EndOrCancelTasksByInstanceName()

Internal function, cancels all the tasks we asked to cancel last frame (by instance name).

Protected function UFunction BlueprintCallable, Category

void

 

EndTaskByInstanceName

(
    FName InstanceName
)

Add any task with this instance name to a list to be ended (not canceled) next frame.

Public function Const

int32

 

GetAbilityLevel

(
    FGameplayAbilitySpecHandle Handle,
    const FGameplayAbilityActorInfo ...
)

Returns current ability level for non instanced abilities.

Public function Const UFunction BlueprintCallable, Category

int32

 

GetAbilityLevel()

Ability Levels and source objects

Returns current level of the Ability

Public function Const UFunction BlueprintCallable, Category

UAbilitySyst ...

 

GetAbilitySystemComponentFromActorInfo()

Returns the AbilitySystemComponent that is activating this ability

Public function Const

UAbilitySyst ...

 

GetAbilitySystemComponentFromActorInfo_Checked()

Returns the AbilitySystemComponent that is activating this ability

Public function Const

UAbilitySyst ...

 

GetAbilitySystemComponentFromActorInfo_Ensured()

Returns the AbilitySystemComponent that is activating this ability

Public function Const UFunction BlueprintCallable, Category

FGameplayAbi ...

 

GetActorInfo()

Returns the actor info associated with this ability, has cached pointers to useful objects

Public function Const UFunction BlueprintCallable, Category

AActor *

 

GetAvatarActorFromActorInfo()

Returns the physical actor that is executing this ability. May be null

Public function Virtual Const UFunction BlueprintCallable, Category

FGameplayEff ...

 

GetContextFromOwner

Generates a GameplayEffectContextHandle from our owner and an optional TargetData.

Public function Virtual Const

UGameplayEff ...

 

GetCooldownGameplayEffect()

Returns the gameplay effect used to determine cooldown

Public function Virtual Const

const FGamep ...

 

GetCooldownTags()

Returns all tags that are currently on cooldown

Public function Const UFunction BlueprintCallable, Category

float

 

GetCooldownTimeRemaining()

Returns the time in seconds remaining on the currently active cooldown.

Public function Virtual Const

float

 

GetCooldownTimeRemaining

(
    const FGameplayAbilityActorInfo ...
)

Returns the time in seconds remaining on the currently active cooldown.

Public function Virtual Const

void

 

GetCooldownTimeRemainingAndDuration

(
    FGameplayAbilitySpecHandle Handle,
    const FGameplayAbilityActorInfo ...,
    float& TimeRemaining,
    float& CooldownDuration
)

Returns the time in seconds remaining on the currently active cooldown and the original duration for this cooldown.

Public function Virtual Const

UGameplayEff ...

 

GetCostGameplayEffect()

Returns the gameplay effect used to apply cost

Public function Const

FGameplayAbi ...

 

GetCurrentAbilitySpec()

Retrieves the actual AbilitySpec for this ability. Can only be called on instanced abilities.

Public function Const

FGameplayAbi ...

 

GetCurrentAbilitySpecHandle()

Gets the current AbilitySpecHandle- can only be called on instanced abilities.

Public function Const

FGameplayAbi ...

 

GetCurrentActivationInfo()

Gets the current activation info bound to this ability - can only be called on instanced abilities.

Public function

FGameplayAbi ...

 

GetCurrentActivationInfoRef()

Gets the current activation info bound to this ability - can only be called on instanced abilities.

Public function Const

const FGamep ...

 

GetCurrentActorInfo()

Gets the current actor info bound to this ability - can only be called on instanced abilities.

Public function Const UFunction BlueprintCallable, Category

UAnimMontage ...

 

GetCurrentMontage()

Animation

Returns the currently playing montage for this ability, if any

Public function Const UFunction BlueprintCallable, Category

UObject *...

 

GetCurrentSourceObject()

Retrieves the SourceObject associated with this ability. Can only be called on instanced abilities.

Public function Const UFunction BlueprintCallable, Category

FGameplayEff ...

 

GetGrantedByEffectContext()

Retrieves the EffectContext of the GameplayEffect that granted this ability.

Public function Const

EGameplayAbi ...

 

GetInstancingPolicy()

The important functions: CanActivateAbility() - const function to see if ability is activatable.

Public function Const

EGameplayAbi ...

 

GetNetExecutionPolicy()

Where does an ability execute on the network? Does a client "ask and predict", "ask and wait", "don't ask (just do it)"

Public function Const

EGameplayAbi ...

 

GetNetSecurityPolicy()

Where should an ability execute on the network? Provides protection from clients attempting to execute restricted abilities.

Public function Const UFunction BlueprintCallable, Category

AActor *

 

GetOwningActorFromActorInfo()

Returns the actor that owns this ability, which may not have a physical location

Public function Const UFunction BlueprintCallable, Category displayname

USkeletalMes ...

 

GetOwningComponentFromActorInfo()

Convenience method for abilities to get skeletal mesh component - useful for aiming abilities

Public function Const

EGameplayAbi ...

 

GetReplicationPolicy()

How an ability replicates state/events to everyone on the network

Public function Const

UObject *...

 

GetSourceObject

(
    FGameplayAbilitySpecHandle Handle,
    const FGameplayAbilityActorInfo ...
)

Retrieves the SourceObject associated with this ability. Callable on non instanced

Public function Virtual Const

UWorld *

 

GetWorld()

Public function Const

bool

 

HasAuthority

(
    const FGameplayAbilityActivationInf ...
)

True if this is the server or single player

Public function Const

bool

 

HasAuthorityOrPredictionKey

(
    const FGameplayAbilityActorInfo ...,
    const FGameplayAbilityActivationInf ...
)

True if we are authority or we have a valid prediciton key that is expected to work

Protected function Const

void

 

IncrementListLock()

Increases the scope lock count.

Public function Virtual

void

 

InputPressed

(
    const FGameplayAbilitySpecHandle Ha...,
    const FGameplayAbilityActorInfo ...,
    const FGameplayAbilityActivationInf ...
)

Input

Input binding stub.

Public function Virtual

void

 

InputReleased

(
    const FGameplayAbilitySpecHandle Ha...,
    const FGameplayAbilityActorInfo ...,
    const FGameplayAbilityActivationInf ...
)

Input binding stub.

Public function Const UFunction BlueprintCallable, Category

void

 

InvalidateClientPredictionKey()

Invalidates the current prediction key.

Public function Const

bool

 

IsActive()

Returns true if the ability is currently active

Public function Virtual Const

bool

 

IsBlockingOtherAbilities()

Returns true if this ability is blocking other abilities

Protected function Const

bool

 

IsEndAbilityValid

(
    const FGameplayAbilitySpecHandle Ha...,
    const FGameplayAbilityActorInfo ...
)

Check if the ability can be ended

Public function Const

bool

 

IsForRemoteClient()

True if this is on the server and is being executed for a non-local player, false in single player

Public function Const

bool

 

IsInstantiated()

True if this has been instanced, always true for blueprints

Public function Const UFunction BlueprintCallable, BlueprintPure, Category, Meta

bool

 

IsLocallyControlled()

True if the owning actor is locally controlled, true in single player

Public function Const

bool

 

IsMarkPendingKillOnAbilityEnd()

Is bMarkPendingKillOnAbilityEnd set

Public function Const

bool

 

IsPredictingClient()

Is this ability running on a a predicting client, this is false in single player

Public function Const

bool

 

IsTriggered()

Is this ability triggered from TriggerData (or is it triggered explicitly through input/game code)

Protected function UFunction Category, Meta, BlueprintImplementableEvent displayname

void

 

K2_ActivateAbility()

ActivateAbility

Protected function UFunction Category, Meta, BlueprintImplementableEvent displayname

void

 

K2_ActivateAbilityFromEvent

(
    const FGameplayEventData & EventDat...
)

Protected function Virtual UFunction BlueprintCallable, Category, Meta displayname

void

 

K2_AddGameplayCue

(
    FGameplayTag GameplayCueTag,
    FGameplayEffectContextHandle Contex...,
    bool bRemoveOnAbilityEnd
)

Adds a persistent gameplay cue to the ability owner. Optionally will remove if ability ends

Protected function Virtual UFunction BlueprintCallable, Category, Meta displayname

void

 

K2_AddGameplayCueWithParams

(
    FGameplayTag GameplayCueTag,
    const FGameplayCueParameters & Game...,
    bool bRemoveOnAbilityEnd
)

Adds a persistent gameplay cue to the ability owner. Optionally will remove if ability ends

Protected function UFunction BlueprintCallable, Category, Meta displayname

FActiveGamep ...

 

K2_ApplyGameplayEffectSpecToOwner

(
    const FGameplayEffectSpecHandle Eff...
)

Apply a previously created gameplay effect spec to the owner of this ability

Protected function UFunction BlueprintCallable, Category, Meta displayname

TArray < FAct ...

 

K2_ApplyGameplayEffectSpecToTarget

(
    const FGameplayEffectSpecHandle Eff...,
    FGameplayAbilityTargetDataHandle Ta...
)

Apply a previously created gameplay effect spec to a target

Protected function Const UFunction Category, Meta, BlueprintImplementableEvent displayname

bool

 

K2_CanActivateAbility

(
    FGameplayAbilityActorInfo ActorInfo,
    FGameplayTagContainer & RelevantTag...
)

CanActivate

Returns true if this ability can be activated right now. Has no side effects

Public function UFunction BlueprintCallable, Category, Meta displayname

void

 

K2_CancelAbility()

Call from Blueprint to cancel the ability naturally

Public function Virtual UFunction BlueprintCallable, Category, Meta displayname

bool

 

K2_CheckAbilityCooldown()

Checks the ability's cooldown, but does not apply it.

Public function Virtual UFunction BlueprintCallable, Category, Meta displayname

bool

 

K2_CheckAbilityCost()

Checks the ability's cost, but does not apply it.

Public function Virtual UFunction BlueprintCallable, Category, Meta displayname

bool

 

K2_CommitAbility()

CommitAbility

Public function Virtual UFunction BlueprintCallable, Category, Meta displayname

bool

 

K2_CommitAbilityCooldown

(
    bool BroadcastCommitEvent,
    bool ForceCooldown
)

Attempts to commit the ability's cooldown only.

Public function Virtual UFunction BlueprintCallable, Category, Meta displayname

bool

 

K2_CommitAbilityCost

(
    bool BroadcastCommitEvent
)

Attempts to commit the ability's cost only.

Public function UFunction Category, Meta, BlueprintImplementableEvent displayname

void

 

K2_CommitExecute()

BP event called from CommitAbility

Protected function Virtual UFunction BlueprintCallable, Category, Meta displayname

void

 

K2_EndAbility()

EndAbility

Call from kismet to end the ability naturally

Protected function Virtual UFunction BlueprintCallable, Category, Meta displayname

void

 

K2_ExecuteGameplayCue

(
    FGameplayTag GameplayCueTag,
    FGameplayEffectContextHandle Contex...
)

GameplayCue Abilities can invoke GameplayCues without having to create GameplayEffects

Protected function Virtual UFunction BlueprintCallable, Category, Meta displayname

void

 

K2_ExecuteGameplayCueWithParams

(
    FGameplayTag GameplayCueTag,
    const FGameplayCueParameters & Game...
)

Invoke a gameplay cue on the ability owner, with extra parameters

Public function Const UFunction BlueprintCallable, BlueprintPure, Category, Meta displayname

bool

 

K2_HasAuthority()

Protected function UFunction Category, Meta, BlueprintImplementableEvent displayname

void

 

K2_OnEndAbility

(
    bool bWasCancelled
)

Kismet event, will be called if an ability ends normally or abnormally

Protected function Virtual UFunction BlueprintCallable, Category, Meta displayname

void

 

K2_RemoveGameplayCue

(
    FGameplayTag GameplayCueTag
)

Removes a persistent gameplay cue from the ability owner

Protected function Const UFunction Category, Meta, BlueprintImplementableEvent displayname

bool

 

K2_ShouldAbilityRespondToEvent

(
    FGameplayAbilityActorInfo ActorInfo,
    FGameplayEventData Payload
)

ShouldAbilityRespondToEvent

Public function Virtual Const

FGameplayEff ...

 

MakeEffectContext

(
    const FGameplayAbilitySpecHandle Ha...,
    const FGameplayAbilityActorInfo ...
)

Returns an effect context, given a specified actor info

Public function Const UFunction BlueprintCallable, Category

FGameplayEff ...

 

MakeOutgoingGameplayEffectSpec

(
    TSubclassOf < UGameplayEffect > Game...,
    float Level
)

Convenience method for abilities to get outgoing gameplay effect specs (for example, to pass on to projectiles to apply to whoever they hit)

Public function Virtual Const

FGameplayEff ...

 

MakeOutgoingGameplayEffectSpec

(
    const FGameplayAbilitySpecHandle Ha...,
    const FGameplayAbilityActorInfo ...,
    const FGameplayAbilityActivationInf ...,
    TSubclassOf < UGameplayEffect > Game...,
    float Level
)

Native version of above function

Protected function UFunction BlueprintPure, Category

FGameplayAbi ...

 

MakeTargetLocationInfoFromOwnerActor()

Target Data

Creates a target location from where the owner avatar is

Protected function UFunction BlueprintPure, Category

FGameplayAbi ...

 

MakeTargetLocationInfoFromOwnerSkeletalMeshComponent

(
    FName SocketName
)

Creates a target location from a socket on the owner avatar's skeletal mesh

Protected function UFunction BlueprintCallable, Category

void

 

MontageJumpToSection

(
    FName SectionName
)

Animation

Immediately jumps the active montage to a section

Protected function UFunction BlueprintCallable, Category

void

 

MontageSetNextSectionName

(
    FName FromSectionName,
    FName ToSectionName
)

Sets pending section on active montage

Protected function UFunction BlueprintCallable, Category, Meta

void

 

MontageStop

(
    float OverrideBlendOutTime
)

Stops the current animation montage.

Public function Virtual

void

 

NotifyAbilityTaskWaitingOnAvatar

(
    UAbilityTask * AbilityTask
)

Called to inform the ability that a task is waiting for the player's avatar to do something in world

Public function Virtual

void

 

NotifyAbilityTaskWaitingOnPlayerData

(
    UAbilityTask * AbilityTask
)

Called to inform the ability that a task is waiting for the player to do something

Public function Virtual

void

 

NotifyAvatarDestroyed()

Called to inform the ability that the AvatarActor has been replaced.

Public function Virtual

void

 

OnAvatarSet

(
    const FGameplayAbilityActorInfo ...,
    const FGameplayAbilitySpec & Spec
)

Called when the avatar actor is set/changes

Public function Virtual

void

 

OnGiveAbility

(
    const FGameplayAbilityActorInfo ...,
    const FGameplayAbilitySpec & Spec
)

Called when the ability is given to an AbilitySystemComponent

Public function Virtual

void

 

OnRemoveAbility

(
    const FGameplayAbilityActorInfo ...,
    const FGameplayAbilitySpec & Spec
)

Called when the ability is removed from an AbilitySystemComponent

Public function Virtual

void

 

OnWaitingForConfirmInputBegin()

Called from AbilityTask_WaitConfirmCancel to handle input confirming

Public function Virtual

void

 

OnWaitingForConfirmInputEnd()

Protected function Virtual

void

 

PostNetInit()

Setters for temporary execution data

Protected function Virtual

void

 

PreActivate

(
    const FGameplayAbilitySpecHandle Ha...,
    const FGameplayAbilityActorInfo ...,
    const FGameplayAbilityActivationInf ...,
    FOnGameplayAbilityEnded::FDelegate ...
)

Do boilerplate init stuff and then call ActivateAbility

Public function Virtual UFunction BlueprintCallable, Category

void

 

RemoveGrantedByEffect()

Removes the GameplayEffect that granted this ability. Can only be called on instanced abilities.

Protected function Virtual UFunction BlueprintCallable, Category

void

 

SendGameplayEvent

(
    FGameplayTag EventTag,
    FGameplayEventData Payload
)

Sends a gameplay event, also creates a prediction window

Public function Virtual UFunction BlueprintCallable, Category

void

 

SetCanBeCanceled

(
    bool bCanBeCanceled
)

Sets whether the ability should ignore cancel requests. Only valid on instanced abilities

Protected function Virtual

void

 

SetCurrentActivationInfo

(
    const FGameplayAbilityActivationInf ...
)

Modifies activation info, only safe on instanced abilities

Protected function Virtual Const

void

 

SetCurrentActorInfo

(
    const FGameplayAbilitySpecHandle Ha...,
    const FGameplayAbilityActorInfo ...
)

Modifies actor info, only safe on instanced abilities

Protected function

void

 

SetCurrentInfo

(
    const FGameplayAbilitySpecHandle Ha...,
    const FGameplayAbilityActorInfo ...,
    const FGameplayAbilityActivationInf ...
)

Sets both actor and activation info

Public function Virtual

void

 

SetCurrentMontage

(
    UAnimMontage * InCurrentMontage
)

Call to set/get the current montage from a montage task.

Public function

void

 

SetMarkPendingKillOnAbilityEnd

(
    bool bInMarkPendingKillOnAbilityEnd
)

Setter for the bMarkPendingKillOnAbilityEnd

Public function Virtual

void

 

SetMovementSyncPoint

(
    FName SyncName
)

Movement Sync

Public function Virtual

void

 

SetRemoteInstanceHasEnded()

Interaction with ability system component

Public function Virtual UFunction BlueprintCallable, Category

void

 

SetShouldBlockOtherAbilities

(
    bool bShouldBlockAbilities
)

Sets rather ability block flags are enabled or disabled. Only valid on instanced abilities

Public function Virtual Const

bool

 

ShouldAbilityRespondToEvent

(
    const FGameplayAbilityActorInfo ...,
    const FGameplayEventData * Payl...
)

Returns true if this ability can be triggered right now. Has no side effects

Public function Virtual Const

bool

 

ShouldActivateAbility

(
    ENetRole Role
)

Returns true if an an ability should be activated

Public function Virtual Const

bool

 

ShouldReplicateAbilitySpec

(
    const FGameplayAbilitySpec & Abilit...
)

Takes in the ability spec and checks if we should allow replication on the ability spec, this will NOT stop replication of the ability UObject just the spec inside the UAbilitySystemComponenet ActivatableAbilities for this ability

Overridden from UObject

Name Description

Public function Virtual

bool

 

CallRemoteFunction

(
    UFunction * Function,
    void * Parms,
    FOutParmRec * OutParms,
    FFrame * Stack
)

Call the actor's function remotely

Public function Virtual

int32

 

GetFunctionCallspace

(
    UFunction * Function,
    FFrame * Stack
)

Return the space this function should be called.

Public function Virtual Const

bool

 

IsSupportedForNetworking()

IsSupportedForNetworking means an object can be referenced over the network

Overridden from IGameplayTaskOwnerInterface

Name Description

Public function Virtual Const

AActor *

 

GetGameplayTaskAvatar

(
    const UGameplayTask * Task
)

Get "body" of task's owner / default, having location in world (e.g. Owner = AIController, Avatar = Pawn)

Public function Virtual Const

AActor *

 

GetGameplayTaskOwner

(
    const UGameplayTask * Task
)

Get owner of a task or default one when task is null

Public function Virtual Const

UGameplayTas ...

 

GetGameplayTasksComponent

(
    const UGameplayTask & Task
)

Finds tasks component for given GameplayTask, Task.GetGameplayTasksComponent() may not be initialized at this point!

Public function Virtual

void

 

OnGameplayTaskActivated

(
    UGameplayTask & Task
)

Notify called after GameplayTask changes state to Active (initial activation or resuming)

Public function Virtual

void

 

OnGameplayTaskDeactivated

(
    UGameplayTask & Task
)

Notify called after GameplayTask changes state from Active (finishing or pausing)

Public function Virtual

void

 

OnGameplayTaskInitialized

(
    UGameplayTask & Task
)

Notify called after GameplayTask finishes initialization (not active yet)

Select Skin
Light
Dark

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback