add_state_transition
Append a StateTree transition from one state to another (GotoState, OnStateCompleted), then compile and save the asset. Use event_name as RequiredEvent for OnEvent triggers.
Instructions
Append a transition from from_state to to_state on a StateTree asset (trigger OnStateCompleted, type GotoState), then compile and save it; each call adds another one. event_name only fills RequiredEvent, which matters with an OnEvent trigger: set that with set_transition_properties. Returns transition_count and saved.
Returns: { tree_path, from_state, to_state, event_name, transition_count, added, saved }
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to_state | No | Name of the target state the transition goes to. | |
| tree_path | Yes | Asset path of the StateTree, e.g. "/Game/AI/ST_Guard". | |
| event_name | No | Gameplay tag stored as the transition RequiredEvent, e.g. "AI.Event.Alert"; a tag that is not registered is ignored without error. | |
| from_state | No | Name of the source state, which owns the new transition. | |
| source_state | No | Alias of `from_state` (same value, same meaning). Accepted because sibling tools spell this parameter differently; prefer `from_state`. | |
| target_state | No | Alias of `to_state` (same value, same meaning). Accepted because sibling tools spell this parameter differently; prefer `to_state`. |