Triggering Events
External gameplay code drives animations by broadcasting events into a VA Mesh Component. Every State Tree using that component receives the event, and any state currently listening for the matching tag transitions in response.
This page covers the three things you need to know:
- How to declare event tags.
- How to broadcast an event from Blueprints.
- How events route through the VA system.
Declaring Event Tags
Section titled “Declaring Event Tags”Gameplay tags are Unreal’s hierarchical naming system. They’re reusable across the whole project. One tag can drive many State Trees.
- Open Project Settings → Project → Gameplay Tags.
- Click Add New Gameplay Tag.
- Enter your tag. For example
Mannequin.WaveorSoccerFan.Goal.- Save. The tag is now available everywhere.
Use dot-separated namespaces to group related tags (Mannequin.Wave, Mannequin.Cheer, Mannequin.Confused). See Transitions. Tag inheritance for how the hierarchy lets you write broad handlers.
Broadcast Anim Event: The Blueprint API
Section titled “Broadcast Anim Event: The Blueprint API”All events enter the VA system through Broadcast Anim Event, called on a VA Mesh Component (or VA Instanced Mesh Component).
Node Pins
Section titled “Node Pins”| Pin | Type | Description |
|---|---|---|
| Target | VA Mesh Component | The component to broadcast on. For instanced crowds, every instance using this component hears the event. |
| Event Tag | Gameplay Tag | The tag to broadcast. Use a Make Literal Gameplay Tag node or a tag variable. |
| Instance Filter (optional) | Array of instance handles | If provided, only those instances receive the event. Leave empty to broadcast to all. |
A Trigger Box Example
Section titled “A Trigger Box Example”The canonical setup: when the player steps into a box, tell an NPC to wave.
- Drop a Trigger Box into the level.
- Open the Level Blueprint and select the Trigger Box in the Outliner.
- Right-click in the graph → Add Event → On Actor Begin Overlap.
- Off the
Other Actorpin, Cast To your player class.- Get a reference to your
BP_VA_NPC(from the level or viaGet Actor Of Class).- Off that reference, call Get VA Mesh → returns the Vertex Animation Mesh Component.
- Off the component, call Broadcast Anim Event with
Event Tag = Mannequin.Wave.
Broadcasting to Crowds
Section titled “Broadcasting to Crowds”The same API broadcasts to an entire crowd. Every instance painted with the same State Tree receives the event simultaneously.
Pattern: goal celebration: A scoring Blueprint calls
BroadcastAnimEvent(CrowdComponent, SoccerFan.Goal). Every fan’s State Tree transitions fromIdletoCheer. Because the VA update pipeline batches instance updates, thousands of instances react in the same frame with negligible per-instance cost.
Targeting Specific Instances
Section titled “Targeting Specific Instances”Pass an array of instance handles to BroadcastAnimEvent to limit the broadcast. Common sources of instance handles:
- The Crowd Editor selection (see Editor Mode Overview) for authored scenarios.
- Spatial queries like
Get Instances In Radiusfor proximity-based effects. - Custom per-instance data - for example, only instances with a particular team tag.
Broadcasting from C++
Section titled “Broadcasting from C++”The C++ entry point lives in UVAStateTreeFunctionLibrary. The Blueprint nodes wrap these same functions; use them directly in native code:
// Broadcast to every instance on the componentUVAStateTreeFunctionLibrary::BroadcastAnimEvent( VAMeshComponent, FGameplayTag::RequestGameplayTag(TEXT("Mannequin.Wave")));
// Broadcast to a specific subsetUVAStateTreeFunctionLibrary::BroadcastAnimEventToInstances( VAMeshComponent, InstanceHandles, WaveTag);Event Filtering and Throttling
Section titled “Event Filtering and Throttling”When thousands of instances respond to the same event, you can reduce the per-event cost with the options in the VA StateTree Schema:
- Filter Animation Events - restrict which tags are dispatched to the tree at all.
- Throttle Events - spread the per-instance dispatch across multiple frames when one event fires on many instances at once (for example, a goal event broadcast to every fan in a stadium).
See Schema & Settings for configuration details.
See Also
Section titled “See Also”- Transitions - how transitions listen for events.
- Schema & Settings - event filtering, throttling, thread mode.