Examples
These patterns use tags as shared gameplay facts. Adapt the vocabulary to the needs of the project rather than copying every example path.
Stunned character
Section titled “Stunned character”Character.State.Stunned- Add the tag when the stun begins.
- Check it before movement, attacks, abilities, and interaction.
- Remove it when the stun expires.
Every participating system reads the same state instead of maintaining separate booleans.
Broad state gate
Section titled “Broad state gate”Owned tags might include:
Character.State.StunnedCharacter.State.FrozenCharacter.State.SilencedQuery the parent when the same branch should apply to any of them:
Query: Character.StateMode: Include ChildrenFaction targeting
Section titled “Faction targeting”Faction.PlayerFaction.EnemyFaction.NeutralFaction.AllyUse an exact faction query for targeting, dialogue branches, or relationship rules. If candidate objects come from a physics query, filter by layer first and then by Gameplay Tag.
Damage identity
Section titled “Damage identity”Damage.Type.FireDamage.Type.IceDamage.Type.PoisonDamage.Resistance.FireDamage.Immunity.PoisonTags describe the damage type, resistance, or immunity. Numeric variables store the damage amount.
Exclusive quest state
Section titled “Exclusive quest state”Quest.Main.AvailableQuest.Main.ActiveQuest.Main.CompletedUse an exclusive parent-group Action to ensure only one child under Quest.Main remains active.
Interaction query
Section titled “Interaction query”Interaction.UsableInteraction.Usable.DoorInteraction.Usable.ChestInteraction.LockedRaycast or overlap to reduce candidates, then query Interaction.Usable with Include Children
to accept doors, chests, and other usable descendants.
Create a Condition workflow
Section titled “Create a Condition workflow”The complete text workflow is available in Getting Started.
C# state component
Section titled “C# state component”using SkywardGames.Runtime.GameplayTags;using UnityEngine;
public class BurningState : MonoBehaviour{ [SerializeField] private GameplayTagComponent tags;
private static readonly GameplayTag Burning = GameplayTag.FromPath("Character.State.Burning");
public bool IsActive => tags.HasTag(Burning, exact: true);
public void Apply() { tags.AddTag(Burning); }
public void Remove() { tags.RemoveTag(Burning); }}
