FGameplayAttribute

Describes a [FGameplayAttributeData](API\Plugins\GameplayAbilities\FGameplayAttributeData) or float property inside an attribute set.

Windows
MacOS
Linux

References

Module

GameplayAbilities

Header

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

Include

#include "AttributeSet.h"

Syntax

[USTRUCT](Programming/UnrealArchitecture/Reference/Structs)([BlueprintType](Programming/UnrealArchitecture/Reference/Structs/Specifiers/BlueprintType))
struct FGameplayAttribute

Remarks

Describes a FGameplayAttributeData or float property inside an attribute set. Using this provides editor UI and helper functions

Variables

Name Description

Public variable UProperty Category BlueprintReadOnly visibleanywhere

FString

 

AttributeName

Name of the attribute, usually the same as property name

Constructors

Name Description

Public function

FGameplayAttribute()

Public function

FGameplayAttribute

(
    FProperty* NewProperty
)

Functions

Name Description

Public function Static

void

 

GetAllAttributeProperties

(
    TArray< FProperty* >& OutProp...,
    FString FilterMetaStr,
    bool UseEditorOnlyData
)

In editor, this will filter out properties with meta tag "HideInDetailsView" or equal to FilterMetaStr.

Public function Const

UClass *

 

GetAttributeSetClass()

Returns the AttributeSet subclass holding this attribute

Public function Const

FGameplayAtt...

 

GetGameplayAttributeData

(
    UAttributeSet* Src
)

Returns the AttributeData, will fail if this is a float attribute

Public function Const

FGameplayAtt...

 

GetGameplayAttributeDataChecked

(
    UAttributeSet* Src
)

Returns the AttributeData, will fail if this is a float attribute

Public function Const

FString

 

GetName()

Returns name of attribute, usually the same as the property

Public function Const

float

 

GetNumericValue

(
    const UAttributeSet* Src
)

Returns the current value of an attribute

Public function Const

float

 

GetNumericValueChecked

(
    const UAttributeSet* Src
)

Returns the current value of an attribute

Public function Const

FProperty &#...

 

GetUProperty()

Returns raw property

Public function Static

bool

 

IsGameplayAttributeDataProperty

(
    const FProperty* Property
)

Returns true if the variable associated with Property is of type FGameplayAttributeData or one of its subclasses

Public function Const

bool

 

IsSystemAttribute()

Returns true if this is one of the special attributes defined on the AbilitySystemComponent itself

Public function Const

bool

 

IsValid()

Public function

void

 

PostSerialize

(
    const FArchive& Ar
)

Custom serialization

Public function Const

void

 

SetNumericValueChecked

(
    float& NewValue,
    UAttributeSet* Dest
)

Modifies the current value of an attribute, will not modify base value if that is supported

Public function

void

 

SetUProperty

(
    FProperty* NewProperty
)

Set up from a FProperty inside a set

Operators

Name Description

Public function Const

bool

 

operator!=

(
    const FGameplayAttribute& Other
)

Public function Const

bool

 

operator==

(
    const FGameplayAttribute& Other
)

Equality/Inequality operators

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