RealDocs

FGameplayTagContainer

struct GameplayTags Blueprint Since 4.15
#include "GameplayTagContainer.h"

Description

A set of FGameplayTags used to express compound state or requirements. Supports hierarchical matching (HasTag, HasAny, HasAll) against another container or tag.

Caveats & Gotchas

  • The container stores both explicitly added tags and their inferred parent tags (ParentTags). HasTag checks both lists; HasTagExact checks only explicit tags. This is a common source of unexpected matches.
  • Containers replicate the full explicit tag list; parent tags are reconstructed on the receiver. Do not rely on ParentTags being populated before NetSerialize completes.
  • IsEmpty() / IsValid() only consider the explicit tag count — an empty container is always considered valid.

Example

Check if an actor has all required tags C++
FGameplayTagContainer RequiredTags;
RequiredTags.AddTag(FGameplayTag::RequestGameplayTag("State.Burning"));
RequiredTags.AddTag(FGameplayTag::RequestGameplayTag("State.Slowed"));

FGameplayTagContainer ActorTags = AbilitySystemComponent->GetOwnedGameplayTags();
if (ActorTags.HasAll(RequiredTags))
{
    // Actor is both burning and slowed
}

Version History

Introduced in: 4.15

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.