Tasks Reference
Tasks are the building blocks of a State Tree. Each state executes one or more tasks while it is active. Vertex Animation Studio ships the following tasks through the VA StateTree Schema:
- Play Vertex Animation - plays a single animation
- Play Random Vertex Animation From Pool - picks one animation from a pool each time the state is entered
- Randomize Bool - rolls a 50/50 boolean into a referenced property
- Set Int Parameter / Set Float Parameter / Set Bool Parameter / Set String Parameter / Set Gameplay Tag Parameter - writes a value into a referenced property
To add any of these, select a state in the StateTree editor and click + in the Tasks panel.
Play Vertex Animation
Section titled “Play Vertex Animation”The workhorse task: plays a single named animation on the instance for the lifetime of the state.
| Property | Type | Default | Description |
|---|---|---|---|
| Animation | VA Compatible Animation | - | The animation to play. Dropdown is filtered by the collection set in the tree’s Asset Details. |
| Play Rate | Float | 1.0 | Playback speed multiplier. |
| Random Start Position | Bool | false | Picks a random start position per instance so crowds don’t animate in lock-step. |
| Start Position | Float | 0.0 | Normalised start time (0–1). Hidden when Random Start Position is enabled. |
| Blend Duration | Float | 0.2 | Blend time (seconds) when transitioning into this animation from whatever was playing. |
| Loop | Bool | false | If true, the animation loops indefinitely and the state never completes on its own. If false, the state fires On State Completed when the clip ends. Pair with an On State Completed transition. |
| Reverse | Bool | false | Plays the animation backwards. |
Tip: For looping behaviours you usually want Loop on. For chained or event-driven behaviours (idle → wave → idle) you usually want Loop off so the state can complete and transition. Blend Duration is what makes transitions between states feel smooth rather than snapping.
Play Random Vertex Animation From Pool
Section titled “Play Random Vertex Animation From Pool”Picks a random animation from an array each time the state is entered. This is the State Tree equivalent of the Animation List Random mode, but driven by state-machine logic.
| Property | Type | Default | Description |
|---|---|---|---|
| Animation Pool | Array of VA Compatible Animation | - | The candidate animations. One is picked uniformly at random on state entry. |
| Play Rate | Float | 1.0 | Playback speed multiplier. |
| Random Start Position | Bool | false | Picks a random start position per instance. |
| Start Position | Float | 0.0 | Normalised start time (0–1). Hidden when Random Start Position is enabled. |
| Blend Duration | Float | 0.2 | Blend time (seconds) into the picked animation. |
| Loop | Bool | false | Loop the picked animation. |
| Reverse | Bool | false | Play the picked animation in reverse. |
Put idle_1, idle_2, idle_3 in the pool and every crowd member rolls their own. Great for breaking up visual repetition across large crowds.
Randomize Bool
Section titled “Randomize Bool”Rolls a 50/50 boolean and writes it into a referenced bool property. Use it on state entry to seed branching decisions for conditions on outgoing transitions.
| Property | Type | Description |
|---|---|---|
| Set Property | Bool property reference | The tree parameter (or bound property) that will receive the rolled value. |
Note: The roll is a fair 50/50 (
FMath::RandBool()). If you need weighted probabilities, use Set Float Parameter with a random range and compare the output in a transition condition.Example: In an Idle state, Randomize Bool →
WillCheer. Add a transition:On State Completed,Condition: WillCheer == true,Next = Cheer. Half of all idle loops chain into a cheer.
Set Parameter
Section titled “Set Parameter”There are five Set Parameter tasks, one per supported value type. Each writes a value into a referenced property on state entry.
| Task | Value Type | Supports Random Range |
|---|---|---|
| Set Int Parameter | Int32 | ✅ |
| Set Float Parameter | Float | ✅ |
| Set Bool Parameter | Bool | - |
| Set String Parameter | FString | - |
| Set Gameplay Tag Parameter | FGameplayTag | - |
Set Int Parameter / Set Float Parameter
Section titled “Set Int Parameter / Set Float Parameter”Both numeric variants share the same properties, differing only in the numeric type.
| Property | Type | Default | Description |
|---|---|---|---|
| Set Property | Int32 / Float property reference | - | The target parameter to write. |
| Use Random Range | Bool | false | If true, the value is rolled in a random range on every state entry. If false, a fixed Value is written. |
| Range | Int32 Interval / Float Interval | 0–1 / 0.0–1.0 | Min/Max inclusive range. Hidden when Use Random Range is off. |
| Value | Int32 / Float | 0 / 0.0 | Fixed value to write. Hidden when Use Random Range is on. |
Example: weighted choice: Set Float Parameter →
DecisionValue, Use Random Range enabled, Range0.0 – 1.0. Then on outgoing transitions, use conditions likeDecisionValue < 0.7 → IdleandDecisionValue >= 0.7 → Cheerfor a 70/30 split.
Set Bool Parameter
Section titled “Set Bool Parameter”| Property | Type | Default | Description |
|---|---|---|---|
| Set Property | Bool property reference | - | The target parameter. |
| Value | Bool | false | The fixed value to write. |
Set String Parameter
Section titled “Set String Parameter”| Property | Type | Default | Description |
|---|---|---|---|
| Set Property | String property reference | - | The target parameter. |
| Value | FString | "" | The fixed value to write. |
Set Gameplay Tag Parameter
Section titled “Set Gameplay Tag Parameter”| Property | Type | Default | Description |
|---|---|---|---|
| Set Property | GameplayTag property reference | - | The target parameter. |
| Value | FGameplayTag | (empty) | The fixed tag to write. |
Example: mood tagging: On entry to each reaction state, Set Gameplay Tag Parameter →
CurrentMood = Mood.Excited. A later state can branch onCurrentMoodvia a tag-matching condition without needing the original event tag.
Combining Tasks
Section titled “Combining Tasks”A state can hold multiple tasks. They enter in the order they are listed on the state. Parameter-setting tasks (Randomize Bool, Set ... Parameter) don’t tick; they write their value on entry and immediately report success. The next task in the list then enters. A common pattern:
- Randomize Bool or Set Parameter: seeds parameters on state entry.
- Play Vertex Animation (Loop off): plays the animation for the state’s lifetime.
- Outgoing transitions read the seeded parameters via conditions when the animation completes.
See Also
Section titled “See Also”- Creating a State Tree Example - full workflow tutorial.
- Transitions - move between states using task outputs as conditions.