Gameplay Tags in Unreal Engine Explained
What Unreal Gameplay Tags are, how parent matching works, the four ways to add tags and how to use them in C++ and Blueprints, with mistakes to avoid.
In this article
Sooner or later every game needs to answer questions like "is this character stunned?", "is this damage fire?" or "can this item go on a shelf?". Strings break with one typo, booleans multiply until a class has thirty of them, and enums cannot be extended without touching code. Gameplay Tags are Unreal Engine's answer: named, hierarchical labels that every system in the project shares.
What a Gameplay Tag is
A tag is a name made of levels separated by dots:
Status.Debuff.Stunned Damage.Type.Fire Item.Category.Food
Every tag is registered in one central list for the project. In the editor you pick tags from that list instead of typing them, so a typo cannot sneak in. Under the hood a tag is stored as a name, so comparing tags is fast.
You do not need the Gameplay Ability System to use them. Tags are their own engine module; GAS just uses them a lot.
The hierarchy is the point
Tags form a tree. Adding Status.Debuff.Stunned automatically makes Status and Status.Debuff exist as parents. That lets you ask broad or narrow questions with one check:
- "Is this character stunned?" → check
Status.Debuff.Stunned - "Does this character have any debuff?" → check
Status.Debuff
Which one you get depends on the function you call:
| Tags on the actor | Check | HasTag | HasTagExact |
|---|---|---|---|
Status.Debuff.Stunned | Status.Debuff.Stunned | true | true |
Status.Debuff.Stunned | Status.Debuff | true | false |
Status.Debuff | Status.Debuff.Stunned | false | false |
HasTag checks the tags in the container and their parents. A parent never matches a more specific child. The same rule applies to HasAny / HasAll and their Exact versions, and to MatchesTag on a single tag.
This is why the tree is worth designing: put tags you want to check as a group under one parent.
Four ways to add tags
| Method | Where it lives | Good for |
|---|---|---|
| Project Settings | Config/DefaultGameplayTags.ini | Most projects; anyone can add tags in the editor |
| Extra .ini files | Config/Tags/*.ini | Splitting a big list by system; plugins |
| DataTable | Row type GameplayTagTableRow, listed under Gameplay Tag Table List | Managing tags in a spreadsheet |
| Native C++ | UE_DECLARE_GAMEPLAY_TAG_EXTERN / UE_DEFINE_GAMEPLAY_TAG | Tags your C++ code checks |
In Project Settings, open Project → Gameplay Tags and use Manage Gameplay Tags to add, rename and delete tags. They are written to the .ini file like this:
[/Script/GameplayTags.GameplayTagsSettings] +GameplayTagList=(Tag="Status.Debuff.Stunned",DevComment="Cannot move or act")
The DevComment shows as a tooltip in the tag picker, so write one for anything that is not obvious. Unreal reads these files when the editor starts: after editing an .ini by hand, restart the editor.
For a long list, typing tags one by one in the editor is slow. The free Gameplay Tags Editor lets you write or paste the whole list as text, shows it as a tree, flags mistakes like double dots or duplicates, and exports the .ini, a DataTable CSV or JSON, or native C++ tags.
Using tags in C++
First add the module to your Build.cs:
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "GameplayTags" });
Store tags in an FGameplayTagContainer (many tags) or an FGameplayTag (one tag):
#include "GameplayTagContainer.h" UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Tags") FGameplayTagContainer OwnedTags; UPROPERTY(EditAnywhere, Category = "Tags", meta = (Categories = "Damage.Type")) FGameplayTag DamageType;
meta = (Categories = "Damage.Type") limits the tag picker to that branch, which keeps designers from picking the wrong kind of tag.
Getting a tag in code
You can look a tag up by name:
const FGameplayTag Stunned = FGameplayTag::RequestGameplayTag(FName("Status.Debuff.Stunned"));
if (OwnedTags.HasTag(Stunned)) { return; }
This works, but the name is still a string: a typo is only caught at runtime. Native tags fix that. Declare them in a header and define them in a .cpp:
// MyGameplayTags.h #pragma once #include "NativeGameplayTags.h" UE_DECLARE_GAMEPLAY_TAG_EXTERN(TAG_Status_Debuff_Stunned); // MyGameplayTags.cpp #include "MyGameplayTags.h" UE_DEFINE_GAMEPLAY_TAG_COMMENT(TAG_Status_Debuff_Stunned, "Status.Debuff.Stunned", "Cannot move or act");
Now OwnedTags.HasTag(TAG_Status_Debuff_Stunned) is checked by the compiler, and the tag is registered automatically when the module loads. Native tags show up in the editor's tag list like any other tag.
Letting other systems read an actor's tags
Implement IGameplayTagAssetInterface and override GetOwnedGameplayTags. Other code can then ask any actor for its tags without knowing its class.
Using tags in Blueprints
Add a variable of type Gameplay Tag or Gameplay Tag Container and pick tags from the dropdown. The nodes mirror the C++ functions: Has Tag, Has Any Tags, Has All Tags, Matches Tag and Add Gameplay Tag. Most have an Exact Match option or an exact variant; leave it off to include parents.
Mistakes to avoid
- Too flat or too deep.
Stunnedalone cannot be grouped;Character.Status.Combat.Debuff.Crowd.Stunnedis tiring to use. A few broad roots and 2–4 levels is usually enough. - Spaces and odd characters. Spaces are allowed but turn into underscores in C++ names and are easy to mistype. Quotes and commas are not allowed.
- Renaming by hand. Deleting a tag that assets still use leaves broken references. Unreal supports tag redirects (
GameplayTagRedirectsin the same .ini) so old names map to new ones; use them when you rename a tag that is already in use. - Using
HasTagExactby habit. ThenStatus.Debuffstops matchingStatus.Debuff.Stunnedand group checks silently fail. - Forgetting the module. Linker errors mentioning
FGameplayTagusually meanGameplayTagsis missing fromBuild.cs.
A starter tree
Ability.Dash Ability.Interact Damage.Type.Fire Damage.Type.Physical Input.Interact Item.Category.Food Item.Category.Tool Status.Buff.Speed Status.Debuff.Stunned
Start small, add tags when a system needs them, and keep the roots stable. Paste this into the Gameplay Tags Editor to see the tree and export it in the format you want. If you write tags as UPROPERTYs, UPROPERTY Specifiers Explained covers the specifiers used above.
Summary
- Gameplay Tags are hierarchical, project-wide labels like
Status.Debuff.Stunned. HasTagmatches parents;HasTagExactdoes not.- Add tags in Project Settings, Config/Tags .ini files, a GameplayTagTableRow DataTable or native C++.
- In C++, add
GameplayTagstoBuild.csand prefer native tags for anything your code checks. - Design the tree so the groups you want to check share a parent.
Frequently asked questions
What are Gameplay Tags in Unreal Engine?
Hierarchical labels such as Status.Debuff.Stunned, registered in one central list for the whole project. You attach them to actors, abilities or items and check them in C++ or Blueprints instead of using strings, booleans or enums.
What is the difference between HasTag and HasTagExact?
HasTag also matches parents: a container with Status.Debuff.Stunned returns true for HasTag(Status.Debuff). HasTagExact only returns true if that exact tag is in the container.
Where does Unreal save Gameplay Tags?
Tags added in Project Settings are saved to Config/DefaultGameplayTags.ini. Unreal can also load .ini files from Config/Tags, DataTables with the GameplayTagTableRow row type and native tags declared in C++.
Do I need the Gameplay Ability System to use Gameplay Tags?
No. Gameplay Tags are a separate engine module. The Gameplay Ability System uses them heavily, but you can use tags in any project, in C++ or Blueprints.