FGameplayAbilitySpec

An activatable ability spec, hosted on the ability system component.

Windows
MacOS
Linux

Inheritance Hierarchy

FFastArraySerializerItem

FGameplayAbilitySpec

References

Module

GameplayAbilities

Header

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

Include

#include "GameplayAbilitySpec.h"

Syntax

[USTRUCT](Programming/UnrealArchitecture/Reference/Structs)([BlueprintType](Programming/UnrealArchitecture/Reference/Structs/Specifiers/BlueprintType))
struct FGameplayAbilitySpec : public FFastArraySerializerItem

Remarks

An activatable ability spec, hosted on the ability system component. This defines both what the ability is (what class, what level, input binding etc) and also holds runtime state that must be kept outside of the ability being instanced/activated.

Variables

Name Description

Public variable UProperty

UGameplayAbilit...

 

Ability

Ability of the spec (Always the CDO. This should be const but too many things modify it currently)

Public variable UProperty notreplicated

FGameplayAbilit...

 

ActivationInfo

Activation state of this ability.

Public variable UProperty notreplicated

uint8

 

ActiveCount

A count of the number of times this ability has been activated minus the number of times it has been ended.

Public variable UProperty notreplicated

uint8: 1

 

bActivateOnce

This ability should be activated once when it is granted.

Public variable UProperty

FGameplayTagCon...

 

DynamicAbilityTags

Optional ability tags that are replicated.

Public variable UProperty notreplicated

FActiveGameplay...

 

GameplayEffectHandle

Handle to GE that granted us (usually invalid)

Public variable UProperty

FGameplayAbilit...

 

Handle

Handle for outside sources to refer to this spec by

Public variable UProperty

int32

 

InputID

InputID, if bound

Public variable UProperty notreplicated

uint8: 1

 

InputPressed

Is input currently pressed. Set to false when input is released

Public variable UProperty

int32

 

Level

Level of Ability

Public variable UProperty notreplicated

TArray< UGamepl...

 

NonReplicatedInstances

Non replicating instances of this ability.

Public variable UProperty notreplicated

uint8: 1

 

PendingRemove

Pending removal due to scope lock

Public variable UProperty notreplicated

uint8: 1

 

RemoveAfterActivation

If true, this ability should be removed as soon as it finishes executing

Public variable UProperty

TArray< UGamepl...

 

ReplicatedInstances

Replicated instances of this ability..

Public variable

TMap< FGameplay...

 

SetByCallerTagMagnitudes

Passed on SetByCaller magnitudes if this ability was granted by a GE

Public variable UProperty

UObject *

 

SourceObject

Object this ability was created from, can be an actor or static object.

Constructors

Name Description

Public function

FGameplayAbilitySpec()

Public function

FGameplayAbilitySpec

(
    FGameplayAbilitySpecDef& InDef,
    int32 InGameplayEffectLevel,
    FActiveGameplayEffectHandle InGamep...
)

Version that takes an existing spec def

Public function

FGameplayAbilitySpec

(
    TSubclassOf< UGameplayAbility > InA...,
    int32 InLevel,
    int32 InInputID,
    UObject* InSourceObject
)

Version that takes an ability class

Public function

FGameplayAbilitySpec

(
    UGameplayAbility* InAbility,
    int32 InLevel,
    int32 InInputID,
    UObject* InSourceObject
)

Version that takes an ability CDO, this exists for backward compatibility

Functions

Name Description

Public function Const

TArray< UGam...

 

GetAbilityInstances()

Returns all instances, which can include instance per execution abilities

Public function

FString

 

GetDebugString()

Public function Const

UGameplayAbi...

 

GetPrimaryInstance()

Returns the primary instance, used for instance once abilities

Public function Const

bool

 

IsActive()

Returns true if this ability is active in any way

Public function

void

 

PostReplicatedAdd

(
    const FGameplayAbilitySpecContainer...
)

Public function

void

 

PreReplicatedRemove

(
    const FGameplayAbilitySpecContainer...
)

Public function Const

bool

 

ShouldReplicateAbilitySpec()

Interface function to see if the ability should replicated the ability spec or not

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