set_state_tree_root
Set a top-level state as the root of a StateTree asset by moving it to the first SubTree slot, then compile and save; nested states are refused, returning root_state with set and saved, or already_root.
Instructions
Make a top-level state the root of a StateTree asset by moving it to the first SubTree slot, then compile and save it. A nested state is refused. Returns root_state with set and saved, or already_root when it was already first (nothing saved).
Returns: { tree_path, root_state, already_root, set, saved }
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tree_path | Yes | Asset path of the StateTree, e.g. "/Game/AI/ST_Guard". | |
| root_state_name | Yes | Name of a top-level state, such as one made by add_state; a state nested under another is refused. |