![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include <GameplayTagContainer.h>
Static Public Attributes | |
| static GAMEPLAYTAGS_API const FGameplayTagQuery | EmptyQuery |
Friends | |
| class | FQueryEvaluator |
An FGameplayTagQuery is a logical query that can be run against an FGameplayTagContainer. A query that succeeds is said to "match". Queries are logical expressions that can test the intersection properties of another tag container (all, any, or none), or the matching state of a set of sub-expressions (all, any, or none). This allows queries to be arbitrarily recursive and very expressive. For instance, if you wanted to test if a given tag container contained tags ((A && B) || (C)) && (!D), you would construct your query in the form ALL( ANY( ALL(A,B), ALL(C) ), NONE(D) )
You can expose the query structs to Blueprints and edit them with a custom editor, or you can construct them natively in code.
Example of how to build a query via code: FGameplayTagQuery Q; Q.BuildQuery( FGameplayTagQueryExpression() .AllTagsMatch() .AddTag(FGameplayTag::RequestGameplayTag(FName(TEXT("Animal.Mammal.Dog.Corgi")))) .AddTag(FGameplayTag::RequestGameplayTag(FName(TEXT("Plant.Tree.Spruce")))) );
Queries are internally represented as a byte stream that is memory-efficient and can be evaluated quickly at runtime. Note: these have an extensive details and graph pin customization for editing, so there is no need to expose the internals to Blueprints.
| FGameplayTagQuery::FGameplayTagQuery | ( | ) |
| FGameplayTagQuery::FGameplayTagQuery | ( | FGameplayTagQuery const & | Other | ) |
| FGameplayTagQuery::FGameplayTagQuery | ( | FGameplayTagQuery && | Other | ) |
| void FGameplayTagQuery::Build | ( | struct FGameplayTagQueryExpression & | RootQueryExpr, |
| FString | InUserDescription = FString() |
||
| ) |
Creates this query with the given root expression.
|
static |
Static function to assemble and return a query.
| void FGameplayTagQuery::Clear | ( | ) |
Resets this query to its default empty state.
| FGameplayTagQuery::GENERATED_BODY | ( | ) |
|
inline |
Returns description string.
| const TArray< FGameplayTag > & FGameplayTagQuery::GetGameplayTagArray | ( | ) | const |
Gets the explicit list of all unique gameplay tags referenced by the query.
|
inline |
Gets the explicit list of all unique gameplay tags referenced by the query.
| void FGameplayTagQuery::GetQueryExpr | ( | struct FGameplayTagQueryExpression & | OutExpr | ) | const |
Builds a FGameplayTagQueryExpression from this query.
| bool FGameplayTagQuery::IsEmpty | ( | ) | const |
Returns true if this query is empty, false otherwise.
|
static |
|
static |
|
static |
|
static |
Shortcuts for easily creating common query types Creates a tag query that will match if there are any common tags between the given tags and the tags being queries against.
|
static |
|
static |
| bool FGameplayTagQuery::Matches | ( | FGameplayTagContainer const & | Tags | ) | const |
Returns true if the given tags match this query, or false otherwise.
| bool FGameplayTagQuery::operator!= | ( | const FGameplayTagQuery & | Other | ) | const |
| FGameplayTagQuery & FGameplayTagQuery::operator= | ( | FGameplayTagQuery && | Other | ) |
| FGameplayTagQuery & FGameplayTagQuery::operator= | ( | FGameplayTagQuery const & | Other | ) |
Assignment/Equality operators
| bool FGameplayTagQuery::operator== | ( | const FGameplayTagQuery & | Other | ) | const |
|
inline |
Replaces existing tags with passed in tag. Does not modify the tag query expression logic. Useful when you need to cache off and update often used query.
|
inline |
Replaces existing tags with passed in tags. Does not modify the tag query expression logic. Useful when you need to cache off and update often used query. Must use same sized tag container!
|
inline |
Sets the user-specified description of this query.
|
friend |
|
static |