statetree_add_state
Insert a new state into a StateTree asset as a root subtree or child state, specifying parent, type, and save behavior.
Instructions
Add a root subtree or child state to a StateTree asset.
Args: state_tree: StateTree asset path or object path. name: State display name to add. parent_state: Optional parent state name or GUID. Empty uses the first root. description: Optional editor description for the state. state_type: "state", "group", "linked", "linked_asset", or "subtree". as_subtree: Add as a top-level subtree instead of child state. enabled: Initial enabled flag. save: Save the asset after mutation.
Returns: Structured JSON with inserted state details and state counts.
KB: see knowledge_base/23_MASS_ENTITY_AND_STATETREE.md#mcp-mass-statetree-and-smartobject-tools Example: statetree_add_state(state_tree="/Game/AI/StateTrees/ST_CombatBrain", name="Patrol", parent_state="Root")
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| save | No | ||
| enabled | No | ||
| as_subtree | No | ||
| state_tree | Yes | ||
| state_type | No | state | |
| description | No | ||
| parent_state | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |