FGameplayTag
#include "GameplayTagContainer.h" Description
A hierarchical name token (e.g. 'Ability.Fire.Projectile') registered in the global gameplay tag dictionary. Used throughout GAS, AI, and gameplay systems to express state and query conditions without hard-coded enums.
Caveats & Gotchas
- • Tags must be registered in the GameplayTags project settings (or a DefaultGameplayTags.ini) before use. Requesting an unregistered tag with ErrorIfNotFound=true will fire an ensure.
- • MatchesTag() checks parent hierarchy — 'Ability.Fire'.MatchesTag('Ability') is true, but 'Ability'.MatchesTag('Ability.Fire') is false. Use MatchesTagExact() for strict equality.
- • FGameplayTag is replicated efficiently as a net index via NetSerialize — it is safe and cheap to use in replicated structs.
Example
Request and compare gameplay tags C++
FGameplayTag FireTag = FGameplayTag::RequestGameplayTag(FName("Ability.Fire"));
FGameplayTag FireProjectileTag = FGameplayTag::RequestGameplayTag(FName("Ability.Fire.Projectile"));
// Hierarchy-aware: true
bool bMatches = FireProjectileTag.MatchesTag(FireTag);
// Strict: false
bool bExact = FireProjectileTag.MatchesTagExact(FireTag); See Also
Tags
Version History
Introduced in: 4.15
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?