Skip to main content

Resource

Patterns

Practical patterns for using gameplay tags with GAS, CommonUI, Enhanced Input, and animation systems.

GAS: Ability blocking and canceling

Gameplay Abilities use tag containers to define what they block, what blocks them, and what they cancel on activation. This is configured per-ability in the class defaults.

Tag containers on UGameplayAbility

Property
What it does
AbilityTagsTags that identify this ability
ActivationBlockedTagsIf the owner has any of these tags, this ability cannot activate
ActivationRequiredTagsThe owner must have all of these tags for this ability to activate
BlockAbilitiesWithTagWhile active, prevent abilities with these tags from activating
CancelAbilitiesWithTagOn activation, cancel any active abilities with these tags
ActivationOwnedTagsTags granted to the owner while this ability is active

Common blocking relationships

Tag on owner
Blocks
Why
State.DeadEverything except Ability.Behavior.SurvivesDeathDead characters can't act
State.StunnedAll action abilitiesStunned characters can't use abilities
State.ChannelingOther action abilitiesCan't start a new action while channeling

GAS: Gameplay effects and tag granting

Gameplay Effects grant tags to their target for as long as the effect is active. This is how status effects, buffs, and debuffs work.

GrantedTags vs DynamicGrantedTags

Property
Behavior
GrantedTagsAdded when GE is applied, removed when GE ends. Static, defined in class defaults.
DynamicGrantedTagsSame behavior, but can be modified at runtime via the GE spec handle.

The removal tag pattern

Some projects use a .Removal suffix to explicitly remove a state tag. For example, applying a GE that grants State.SprintingRemoval removes State.Sprinting through tag container logic. This is common in GASShooter-style projects.

GAS: Gameplay Cues

The engine routes cue events by matching the GameplayCue. prefix. This prefix is not optional. If a tag doesn't start with GameplayCue., the cue system ignores it.

Cue event types

Event
When it fires
OnExecuteInstant one-shot (for example, hit impact)
OnActiveWhen the cue is first activated
WhileActiveEvery tick while the cue is active
OnRemoveWhen the cue is deactivated

The tag hierarchy determines which handler responds. A handler for GameplayCue.Weapon.Impact catches GameplayCue.Weapon.Impact.Metal and GameplayCue.Weapon.Impact.Wood unless more specific handlers exist.

CommonUI: Layer and activation tags

CommonUI uses gameplay tags to identify widget layers. Each layer is a stack. Pushing a widget onto UI.Layer.Menu pauses the UI.Layer.Game layer below it.

Layer tag
Use
UI.Layer.GameHUD elements visible during gameplay
UI.Layer.GameMenuIn-game overlays (pause, inventory)
UI.Layer.MenuFull-screen menus (main menu, settings)
UI.Layer.ModalModal dialogs (confirm, alert)

UI.Action.* tags route platform-agnostic input actions through CommonUI. For example, UI.Action.Back maps to Escape on keyboard and B/Circle on gamepad. The layer system handles which widget receives the action.

Enhanced Input: Tag-based ability binding

Lyra maps Enhanced Input Actions to Gameplay Abilities via InputTag.* tags. Each Input Action is associated with a tag, and the ability system activates the ability that matches.

Input mapping (data asset)
Input Action: IA_Fire    → InputTag.Ability.Fire
Input Action: IA_Jump    → InputTag.Ability.Jump
Input Action: IA_Dash    → InputTag.Ability.Dash
Input Action: IA_Reload  → InputTag.Ability.Reload
Input Action: IA_Move    → InputTag.Move
Input Action: IA_Look    → InputTag.Look.Mouse

The ability is granted with a matching InputTag. When the Input Action fires, the system finds the ability whose input tag matches and activates it. This decouples the physical key binding from the ability.

Animation: Tag-driven state selection

Animation Blueprints can bind gameplay tags to boolean properties via the Gameplay Tag Property Map in class defaults. When the owner gains or loses a tag, the bound property updates automatically without polling.

Tag
Drives
State.AimingbIsAiming (switches to aim offset blend space)
State.CrouchingbIsCrouching (selects crouch locomotion)
State.SprintingbIsSprinting (drives sprint blend)
State.DeadbIsDead (triggers death montage)

This is configured in the Anim Blueprint's class defaults under Gameplay Tags > Gameplay Tag Property Map. It's ideal to use this instead of manually polling tags in the animation graph.

Unreal Directive is free and ad-free.

If it saved you time, you can help keep it that way.

Donate