Skip to main content
Flow Core Documentation
Menu

Execution & Queries

GUID Tag Combinations

Discover registered GameObjects with explicit OR and AND combinations of GameObjectGuid tags.

Audience
Working with Flow Core
Time
15 minutes
Requires
A writable Unity scene with a FlowCoreProcess and Local Blackboard
Modules
Flow Core
On this page

Use Find GameObjectGuid By Tags when a graph needs to discover a group of registered objects by role instead of holding exact references. This tutorial runs the same [Enemy, Ranged] query twice so the difference between Or and And is visible in both the result lists and counts.

What you will query

Create three objects with overlapping GameObjectGuid tags:

GameObjectTags
Enemy ArcherEnemy, Ranged
Enemy BruteEnemy, Melee
Defense TurretDefense, Ranged

For the query [Enemy, Ranged], Or matches all three objects because each has at least one requested tag. And matches only Enemy Archer because it has both requested tags.

Add the tag whitelist

  1. Open Edit > Project Settings > Flow Core.
  2. Find GameObjectGuid Tags.
  3. Add Enemy, Defense, Ranged, and Melee.

The whitelist helps authors reuse consistent literal names in supported tag pickers. It is not a runtime validator: a tag does not have to be listed there to exist or match at runtime.

Tag the three GameObjects

  1. Create three GameObjects named Enemy Archer, Enemy Brute, and Defense Turret.
  2. Add GameObjectGuid to each object.
  3. In the component’s Tags tab, assign the two tags shown in the table above.

Three GameObjectGuid Inspectors showing Enemy Archer with Enemy and Ranged, Enemy Brute with Enemy and Melee, and Defense Turret with Defense and Ranged

Create the output keys

On the Local Blackboard used by your FlowCoreProcess, create these keys:

TypeKeys
GameObject ListOrResults, AndResults
IntOrCount, AndCount

Keep this Blackboard at Local index 0. The two list keys make the matching members inspectable; the two integer keys make the expected counts easy to verify or branch on later.

Build the two combination queries

  1. Create a Flow Graph, assign it to the FlowCoreProcess, and add a Unity Start Trigger.
  2. Connect the Trigger to an Action node.
  3. Add Find GameObjectGuid By Tags from GameObject/Guid/Tags.
  4. Set Tags to the literal list Enemy, Ranged.
  5. Set Match Mode to Or.
  6. Write Results to Local Blackboard index 0, key OrResults.
  7. Write Count to Local Blackboard index 0, key OrCount.
  8. Add a second Find GameObjectGuid By Tags instruction to the same Action.
  9. Use the same literal tags, set Match Mode to And, and write to AndResults and AndCount.

Start Trigger connected to one Action with OR and AND Find GameObjectGuid By Tags instructions using the same Enemy and Ranged tag list

The instructions run in order, but neither query depends on the other’s output. Their separate keys keep the comparison explicit.

Verify in Play Mode

  1. Save the graph and scene.
  2. Enter Play Mode after all three tagged objects are active and registered.
  3. Open the Local Blackboard’s Edit view.
  4. Expand both result lists.

The expected result is:

QueryMatching setCount
OrEnemy Archer, Enemy Brute, and Defense Turret3
AndEnemy Archer1

Runtime Local Blackboard showing three OR matches with OrCount 3 and one AND match with AndCount 1

Know the query boundaries

  • Tags are trimmed at their ends, but matching remains case-sensitive. Enemy and enemy are different tags.
  • Empty or whitespace-only query entries are ignored. If no usable query tags remain, every registered GameObjectGuid matches.
  • The Project Settings whitelist improves authoring consistency but does not reject runtime tags outside the list.
  • Runtime discovery searches registered GameObjectGuid components. If an expected object is missing, confirm that it is active and registered before the Action runs.
  • Result order is an implementation detail. Branch on membership or count, not on list position.
  • If the graph already knows one exact object, prefer a direct reference instead of searching the registry.

When you already have a target

Use Has GameObjectGuid Tags when a target GameObject is already resolved and the graph only needs a bool for an Or or And membership check. Use Find GameObjectGuid By Tags when the graph must discover all matching objects.

The single-tag Has GameObjectGuid Tag and Find GameObjectGuid By Tag instructions are shorter forms for one tag. See the GameObjectGuid tag instruction Tech Docs for the complete instruction reference.

Common Mistakes

SymptomCheck
Both queries return 0Confirm the objects are active, registered, and own GameObjectGuid.
And returns too many objectsConfirm both instructions use [Enemy, Ranged] and the second mode is And.
A visually similar tag missesCompare capitalization and remove unintended internal characters.
Results cannot be writtenConfirm the Local index, key names, and Blackboard value types.
Downstream logic changes run to runDo not depend on the result list’s order.

What You Built

You created an overlapping tag model, ran the same multi-tag query with both match modes, and stored inspectable GameObject List and Int outputs. The result demonstrates the main strength of the GUID Tag system: composing roles such as affiliation and combat range without hard-coding individual scene references.