Ready-made StateTree tools for Unreal Engine 5
Plugin: StateTreeToolsGameplayAbilitySystem
Class: UGASEventForwarder
This component is only available when Unreal’s built-in Gameplay Abilities plugin is enabled.
Bridges the Gameplay Ability System and the StateTree event system. Add this component to any actor that has an UAbilitySystemComponent. It handles two kinds of forwarding:
FGameplayEventData to a chosen StateTree event tag.Both mechanisms run automatically at BeginPlay with no C++ required.
A map from a GAS gameplay event tag to a StateTree event configuration. Each entry has:
| Field | Description |
|---|---|
Key (FGameplayTag) |
The GAS gameplay event tag to listen for |
StateTree Tag |
The tag to use when forwarding the event into the StateTree |
When the GAS event fires, the full FGameplayEventData payload is wrapped in an FInstancedStruct and sent to all UStateTreeComponents on the actor under the mapped StateTree tag. Bind Payload.EventTag, Payload.Instigator, Payload.Target, Payload.EventMagnitude, or other fields in your StateTree transitions.
A list of gameplay tags. Whenever one of these tags is added to the actor’s ASC, a StateTree event is fired with the tag StateTreeTools.Events.TagAdded. The payload is FTagChangedPayload:
| Field | Type | Description |
|---|---|---|
ChangedTag |
FGameplayTag |
The tag that was added |
If the tag is already present when BeginPlay runs, the event fires immediately.
A list of gameplay tags. Whenever one of these tags is removed from the actor’s ASC, a StateTree event is fired with the tag StateTreeTools.Events.TagRemoved. The payload is also FTagChangedPayload with the tag that was removed.
If the tag is already absent when BeginPlay runs, the event fires immediately.
UGASEventForwarder to any actor that has an UAbilitySystemComponent.StateTreeTools.Events.TagAdded, StateTreeTools.Events.TagRemoved, or your custom mapped tag).The component logs an error if no UAbilitySystemComponent is found on the owner when tag watching is configured.