UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FGameplayTag Struct Reference

#include <GameplayTagContainer.h>

+ Inheritance diagram for FGameplayTag:

Public Member Functions

 FGameplayTag ()
 
bool operator== (FGameplayTag const &Other) const
 
bool operator!= (FGameplayTag const &Other) const
 
bool operator< (FGameplayTag const &Other) const
 
GAMEPLAYTAGS_API bool MatchesTag (const FGameplayTag &TagToCheck) const
 
bool MatchesTagExact (const FGameplayTag &TagToCheck) const
 
GAMEPLAYTAGS_API int32 MatchesTagDepth (const FGameplayTag &TagToCheck) const
 
GAMEPLAYTAGS_API bool MatchesAny (const FGameplayTagContainer &ContainerToCheck) const
 
bool MatchesAnyExact (const FGameplayTagContainer &ContainerToCheck) const
 
bool IsValid () const
 
GAMEPLAYTAGS_API FGameplayTagContainer GetSingleTagContainer () const
 
GAMEPLAYTAGS_API FGameplayTag RequestDirectParent () const
 
GAMEPLAYTAGS_API FGameplayTagContainer GetGameplayTagParents () const
 
GAMEPLAYTAGS_API void ParseParentTags (TArray< FGameplayTag > &UniqueParentTags) const
 
GAMEPLAYTAGS_API FName GetTagLeafName () const
 
FString ToString () const
 
FName GetTagName () const
 
GAMEPLAYTAGS_API bool NetSerialize (FArchive &Ar, class UPackageMap *Map, bool &bOutSuccess)
 
GAMEPLAYTAGS_API void PostSerialize (const FArchive &Ar)
 
GAMEPLAYTAGS_API bool NetSerialize_Packed (FArchive &Ar, class UPackageMap *Map, bool &bOutSuccess)
 
GAMEPLAYTAGS_API bool SerializeFromMismatchedTag (const FPropertyTag &Tag, FStructuredArchive::FSlot Slot)
 
GAMEPLAYTAGS_API void FromExportString (const FString &ExportString, int32 PortFlags=0)
 
GAMEPLAYTAGS_API bool ImportTextItem (const TCHAR *&Buffer, int32 PortFlags, UObject *Parent, FOutputDevice *ErrorText)
 

Static Public Member Functions

static GAMEPLAYTAGS_API FGameplayTag RequestGameplayTag (const FName &TagName, bool ErrorIfNotFound=true)
 
static GAMEPLAYTAGS_API bool IsValidGameplayTagString (const FString &TagString, FText *OutError=nullptr, FString *OutFixedString=nullptr)
 

Static Public Attributes

static GAMEPLAYTAGS_API const FGameplayTag EmptyTag
 

Protected Member Functions

bool NetSerialize_ForReplayUsingFastReplication (FArchive &Ar, class UPackageMapClient &PackageMapClient)
 
GAMEPLAYTAGS_API FGameplayTag (const FName &InTagName)
 

Protected Attributes

FName TagName
 

Friends

class UGameplayTagsManager
 
class FGameplayTagRedirectors
 
class FNativeGameplayTag
 
struct FGameplayTagContainer
 
struct FGameplayTagNode
 
uint32 GetTypeHash (const FGameplayTag &Tag)
 
FArchiveoperator<< (FArchive &Ar, FGameplayTag &GameplayTag)
 
void operator<< (FStructuredArchive::FSlot Slot, FGameplayTag &GameplayTag)
 

Detailed Description

A single gameplay tag, which represents a hierarchical name of the form x.y that is registered in the GameplayTagsManager You can filter the gameplay tags displayed in the editor using, meta = (Categories = "Tag1.Tag2.Tag3"))

Constructor & Destructor Documentation

◆ FGameplayTag() [1/2]

FGameplayTag::FGameplayTag ( )
inline

Constructors

◆ FGameplayTag() [2/2]

FGameplayTag::FGameplayTag ( const FName InTagName)
explicitprotected

Intentionally private so only the tag manager can use

Member Function Documentation

◆ FromExportString()

void FGameplayTag::FromExportString ( const FString &  ExportString,
int32  PortFlags = 0 
)

Sets from a ImportText string, used in asset registry

◆ GetGameplayTagParents()

FGameplayTagContainer FGameplayTag::GetGameplayTagParents ( ) const

Returns a new tag container that includes this tag and all parent tags as explicitly added tags. For example, calling this on x.y.z would return a tag container with x.y.z, x.y, and x

◆ GetSingleTagContainer()

FGameplayTagContainer FGameplayTag::GetSingleTagContainer ( ) const

Returns a GameplayTagContainer containing only this tag

◆ GetTagLeafName()

FName FGameplayTag::GetTagLeafName ( ) const

Parses the tag name and returns the name of the leaf. For example, calling this on x.y.z would return the z component.

◆ GetTagName()

FName FGameplayTag::GetTagName ( ) const
inline

Get the tag represented as a name

◆ ImportTextItem()

bool FGameplayTag::ImportTextItem ( const TCHAR *&  Buffer,
int32  PortFlags,
UObject Parent,
FOutputDevice ErrorText 
)

Handles importing tag strings without (TagName=) in it

◆ IsValid()

bool FGameplayTag::IsValid ( ) const
inline

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

◆ IsValidGameplayTagString()

bool FGameplayTag::IsValidGameplayTagString ( const FString &  TagString,
FText OutError = nullptr,
FString *  OutFixedString = nullptr 
)
static

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

Parameters
TagStringString to check for validity
OutErrorIf non-null and string invalid, will fill in with an error message
OutFixedStringIf non-null and string invalid, will attempt to fix. Will be empty if no fix is possible
Returns
True if this can be added to the tag dictionary, false if there's a syntax error

◆ MatchesAny()

bool FGameplayTag::MatchesAny ( const FGameplayTagContainer ContainerToCheck) const

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

Returns
True if this tag matches ANY of the tags of in ContainerToCheck

◆ MatchesAnyExact()

bool FGameplayTag::MatchesAnyExact ( const FGameplayTagContainer ContainerToCheck) const
inline

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

Returns
True if this tag matches ANY of the tags of in ContainerToCheck exactly

◆ MatchesTag()

bool FGameplayTag::MatchesTag ( const FGameplayTag TagToCheck) const

Determine if this tag matches TagToCheck, expanding out 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

Returns
True if this tag matches TagToCheck

◆ MatchesTagDepth()

int32 FGameplayTag::MatchesTagDepth ( const FGameplayTag TagToCheck) const

Check to see how closely two FGameplayTags match. Higher values indicate more matching terms in the tags.

Parameters
TagToCheckTag to match against
Returns
The depth of the match, higher means they are closer to an exact match

◆ MatchesTagExact()

bool FGameplayTag::MatchesTagExact ( const FGameplayTag TagToCheck) const
inline

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

Returns
True if TagToCheck is Valid and is exactly this tag

◆ NetSerialize()

bool FGameplayTag::NetSerialize ( FArchive Ar,
class UPackageMap Map,
bool bOutSuccess 
)

Overridden for fast serialize

◆ NetSerialize_ForReplayUsingFastReplication()

bool FGameplayTag::NetSerialize_ForReplayUsingFastReplication ( FArchive Ar,
class UPackageMapClient PackageMapClient 
)
protected

◆ NetSerialize_Packed()

bool FGameplayTag::NetSerialize_Packed ( FArchive Ar,
class UPackageMap Map,
bool bOutSuccess 
)

◆ operator!=()

bool FGameplayTag::operator!= ( FGameplayTag const &  Other) const
inline

◆ operator<()

bool FGameplayTag::operator< ( FGameplayTag const &  Other) const
inline

◆ operator==()

bool FGameplayTag::operator== ( FGameplayTag const &  Other) const
inline

Operators

◆ ParseParentTags()

void FGameplayTag::ParseParentTags ( TArray< FGameplayTag > &  UniqueParentTags) const

Parses the tag name and fills in UniqueParentTags with raw parent tags, without validating with the tag manager. For example, calling this on x.y.z would add x.y and x to UniqueParentTags if they were not already in the array

◆ PostSerialize()

void FGameplayTag::PostSerialize ( const FArchive Ar)

Handles fixup and errors. This is only called when not serializing a full FGameplayTagContainer

◆ RequestDirectParent()

FGameplayTag FGameplayTag::RequestDirectParent ( ) const

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

◆ RequestGameplayTag()

FGameplayTag FGameplayTag::RequestGameplayTag ( const FName TagName,
bool  ErrorIfNotFound = true 
)
static

Gets the FGameplayTag that corresponds to the TagName

Parameters
TagNameThe Name of the tag to search for
ErrorIfNotfoundensure() that tag exists.
Returns
Will return the corresponding FGameplayTag or an empty one if not found.

◆ SerializeFromMismatchedTag()

bool FGameplayTag::SerializeFromMismatchedTag ( const FPropertyTag Tag,
FStructuredArchive::FSlot  Slot 
)

Used to upgrade a Name property to a GameplayTag struct property

◆ ToString()

FString FGameplayTag::ToString ( ) const
inline

Displays gameplay tag as a string for blueprint graph usage

Friends And Related Symbol Documentation

◆ FGameplayTagContainer

◆ FGameplayTagNode

◆ FGameplayTagRedirectors

◆ FNativeGameplayTag

friend class FNativeGameplayTag
friend

◆ GetTypeHash

uint32 GetTypeHash ( const FGameplayTag Tag)
friend

Used so we can have a TMap of this struct

◆ operator<< [1/2]

FArchive & operator<< ( FArchive Ar,
FGameplayTag GameplayTag 
)
friend

◆ operator<< [2/2]

void operator<< ( FStructuredArchive::FSlot  Slot,
FGameplayTag GameplayTag 
)
friend

◆ UGameplayTagsManager

Member Data Documentation

◆ EmptyTag

const FGameplayTag FGameplayTag::EmptyTag
static

An empty Gameplay Tag

◆ TagName

FName FGameplayTag::TagName
protected

This Tags Name


The documentation for this struct was generated from the following files: