FGameplayTag

A single gameplay tag, which represents a hierarchical name of the form x.y that is registered in the GameplayTagsManager

Windows
MacOS
Linux

References

Module

GameplayTags

Header

/Engine/Source/Runtime/GameplayTags/Classes/GameplayTagContainer.h

Include

#include "GameplayTagContainer.h"

Syntax

struct FGameplayTag

Remarks

A single gameplay tag, which represents a hierarchical name of the form x.y that is registered in the GameplayTagsManager

Variables

Name Description

Protected variable

FName

 

TagName

This Tags Name

Constructors

Name Description

Public function

FGameplayTag()

Constructors

Protected function

FGameplayTag

(
    FName InTagName
)

Intentionally private so only the tag manager can use

Functions

Name Description

Public function

void

 

FromExportString

(
    const FString& ExportString
)

Sets from a ImportText string, used in asset registry

Public function Const

FGameplayTag...

 

GetGameplayTagParents()

Returns a new container explicitly containing the tags of this tag

Public function Const

const FGamep...

 

GetSingleTagContainer()

Returns reference to a GameplayTagContainer containing only this tag

Public function Const

FName

 

GetTagName()

Get the tag represented as a name

Public function

bool

 

ImportTextItem

(
    const TCHAR*& Buffer,
    int32 PortFlags,
    UObject* Parent,
    FOutputDevice* ErrorText
)

Handles importing tag strings without (TagName=) in it

Public function Const

bool

 

IsValid()

Returns whether the tag is valid or not; Invalid tags are set to NAME_None and do not exist in the game-specific global dictionary

Public function Static

bool

 

IsValidGameplayTagString

(
    const FString& TagString,
    FText* OutError,
    FString* OutFixedString
)

Returns true if this is a valid gameplay tag string (foo.bar.baz). If false, it will fill

Public function Const

bool

 

MatchesAny

(
    const FGameplayTagContainer& Conta...
)

Checks if this tag matches ANY of the tags in the specified container, also checks against our parent tags "A.1".MatchesAny({"A","B"}) will return True, "A".MatchesAny({"A.1","B"}) will return False If ContainerToCheck is empty/invalid it will always return False

Public function Const

bool

 

MatchesAnyExact

(
    const FGameplayTagContainer& Conta...
)

Checks if this tag matches ANY of the tags in the specified container, only allowing exact matches "A.1".MatchesAny({"A","B"}) will return False If ContainerToCheck is empty/invalid it will always return False

Public function Const

bool

 

MatchesTag

(
    const FGameplayTag& TagToCheck
)

Determine if this tag matches TagToCheck, expanding our parent tags "A.1".MatchesTag("A") will return True, "A".MatchesTag("A.1") will return False If TagToCheck is not Valid it will always return False

Public function Const

int32

 

MatchesTagDepth

(
    const FGameplayTag& TagToCheck
)

Check to see how closely two FGameplayTags match.

Public function Const

bool

 

MatchesTagExact

(
    const FGameplayTag& TagToCheck
)

Determine if TagToCheck is valid and exactly matches this tag "A.1".MatchesTagExact("A") will return False If TagToCheck is not Valid it will always return False

Public function

bool

 

NetSerialize

(
    FArchive& Ar,
    UPackageMap* Map,
    bool& bOutSuccess
)

Overridden for fast serialize

Public function

bool

 

NetSerialize_Packed

(
    FArchive& Ar,
    UPackageMap* Map,
    bool& bOutSuccess
)

Public function

void

 

PostSerialize

(
    const FArchive& Ar
)

Handles fixup and errors.

Public function Const

FGameplayTag

 

RequestDirectParent()

Returns direct parent GameplayTag of this GameplayTag, calling on x.y will return x

Public function Static

FGameplayTag

 

RequestGameplayTag

(
    FName TagName,
    bool ErrorIfNotFound
)

Gets the FGameplayTag that corresponds to the TagName

Public function

bool

 

SerializeFromMismatchedTag

(
    const FPropertyTag& Tag,
    FStructuredArchive::FSlot Slot
)

Used to upgrade a Name property to a GameplayTag struct property

Public function Const

FString

 

ToString()

Displays gameplay tag as a string for blueprint graph usage

Operators

Name Description

Public function Const

bool

 

operator!=

(
    FGameplayTag const& Other
)

Public function Const

bool

 

operator<

(
    FGameplayTag const& Other
)

Public function Const

bool

 

operator==

(
    FGameplayTag const& Other
)

Operators

Constants

Name

Description

EmptyTag

An empty Gameplay Tag

Deprecated Functions

Name Description

Public function Const

bool

 

ComplexMatches

(
    TEnumAsByte< EGameplayTagMatchType:...,
    const FGameplayTag& Other,
    TEnumAsByte< EGameplayTagMatchType:...
)

Deprecated in favor of MatchesTag

Public function Const

bool

 

Matches

(
    TEnumAsByte< EGameplayTagMatchType:...,
    const FGameplayTag& Other,
    TEnumAsByte< EGameplayTagMatchType:...
)

Deprecated in favor of MatchesTag

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