Navigation
API > API/Plugins > API/Plugins/GameplayAbilities
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.
| Name | FGameplayAbilitySpec |
| Type | struct |
| Header File | /Engine/Plugins/Runtime/GameplayAbilities/Source/GameplayAbilities/Public/GameplayAbilitySpec.h |
| Include Path | #include "GameplayAbilitySpec.h" |
Syntax
USTRUCT (BlueprintType )
struct FGameplayAbilitySpec : public FFastArraySerializerItem
Inheritance Hierarchy
- FFastArraySerializerItem → FGameplayAbilitySpec
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FGameplayAbilitySpec
(
UGameplayAbility* InAbility, |
Version that takes an ability CDO, this exists for backward compatibility | GameplayAbilitySpec.h | |
FGameplayAbilitySpec
(
TSubclassOf< UGameplayAbility > InAbilityClass, |
Version that takes an ability class | GameplayAbilitySpec.h | |
FGameplayAbilitySpec
(
FGameplayAbilitySpecDef& InDef, |
Version that takes an existing spec def | GameplayAbilitySpec.h | |
| GameplayAbilitySpec.h | |||
PRAGMA_DISABLE_DEPRECATION_WARNINGS FGameplayAbilitySpec
(
const FGameplayAbilitySpec& |
GameplayAbilitySpec.h | ||
| GameplayAbilitySpec.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
~FGameplayAbilitySpec() |
GameplayAbilitySpec.h |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| Ability | TObjectPtr< UGameplayAbility > | Ability of the spec (Always the CDO. This should be const but too many things modify it currently) | GameplayAbilitySpec.h | |
| ActivationInfo | FGameplayAbilityActivationInfo | Activation state of this ability. | GameplayAbilitySpec.h |
|
| ActiveCount | uint8 | A count of the number of times this ability has been activated minus the number of times it has been ended. | GameplayAbilitySpec.h |
|
| bActivateOnce | uint8 | This ability should be activated once when it is granted. | GameplayAbilitySpec.h |
|
| DynamicAbilityTags | FGameplayTagContainer | Optional ability tags that are replicated. | GameplayAbilitySpec.h | |
| GameplayEffectHandle | FActiveGameplayEffectHandle | Handle to GE that granted us (usually invalid). | GameplayAbilitySpec.h |
|
| GameplayEventData | TSharedPtr< FGameplayEventData > | Cached GameplayEventData if this ability was pending for add and activate due to scope lock | GameplayAbilitySpec.h | |
| Handle | FGameplayAbilitySpecHandle | Handle for outside sources to refer to this spec by | GameplayAbilitySpec.h | |
| InputID | int32 | InputID, if bound | GameplayAbilitySpec.h | |
| InputPressed | uint8 | Is input currently pressed. Set to false when input is released | GameplayAbilitySpec.h |
|
| Level | int32 | Level of Ability | GameplayAbilitySpec.h | |
| NonReplicatedInstances | TArray< TObjectPtr< UGameplayAbility > > | Non replicating instances of this ability. | GameplayAbilitySpec.h |
|
| PendingRemove | uint8 | Pending removal due to scope lock | GameplayAbilitySpec.h |
|
| RemoveAfterActivation | uint8 | If true, this ability should be removed as soon as it finishes executing | GameplayAbilitySpec.h |
|
| ReplicatedInstances | TArray< TObjectPtr< UGameplayAbility > > | Replicated instances of this ability.. | GameplayAbilitySpec.h | |
| SetByCallerTagMagnitudes | TMap< FGameplayTag, float > | Passed on SetByCaller magnitudes if this ability was granted by a GE | GameplayAbilitySpec.h | |
| SourceObject | TWeakObjectPtr< UObject > | Object this ability was created from, can be an actor or static object. | GameplayAbilitySpec.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
TArray< UGameplayAbility * > GetAbilityInstances() |
Returns all instances, which can include InstancedPerExecution abilities | GameplayAbilitySpec.h | |
FString GetDebugString() |
GameplayAbilitySpec.h | ||
PRAGMA_DISABLE_DEPRECATION_WARNINGSFGameplayTagContainer & GetDynamicSpecSourceTags () |
Optional tags that are replicated with this AbilitySpec. | GameplayAbilitySpec.h | |
const FGameplayTagContainer & GetDynamicSpecSourceTags () |
GameplayAbilitySpec.h | ||
UGameplayAbility * GetPrimaryInstance() |
Returns the primary instance, only valid on InstancedPerActor abilities (returns nullptr otherwise) | GameplayAbilitySpec.h | |
bool IsActive() |
Returns true if this ability is active in any way | GameplayAbilitySpec.h | |
void PostReplicatedAdd
(
const FGameplayAbilitySpecContainer& InArraySerializer |
GameplayAbilitySpec.h | ||
void PostReplicatedChange
(
const FGameplayAbilitySpecContainer& InArraySerializer |
GameplayAbilitySpec.h | ||
void PreReplicatedRemove
(
const FGameplayAbilitySpecContainer& InArraySerializer |
GameplayAbilitySpec.h | ||
bool ShouldReplicateAbilitySpec() |
Interface function to see if the ability should replicated the ability spec or not | GameplayAbilitySpec.h |
Operators
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FGameplayAbilitySpec & operator=
(
const FGameplayAbilitySpec& |
GameplayAbilitySpec.h | ||
| GameplayAbilitySpec.h |