build_behavior_tree
Construct a complete Unreal Engine Behavior Tree graph from a JSON description, including nodes, links, decorators, and services, in one call.
Instructions
Build an entire Behavior Tree graph from a JSON description in one call.
This is the primary tool for creating BT logic. Pass the full tree as a nested JSON object and the C++ plugin will build every node, link pins, attach decorators/services, and save the asset.
Node type strings (case-insensitive): Composites : "Selector", "Sequence" Tasks : "Wait", "MoveTo" Custom : full class name e.g. "BTTask_MyCustomTask" or Blueprint path
Tree format: { "type": "Selector", "children": [ { "type": "Sequence", "decorators": [{"type": "BTDecorator_Blackboard", "properties": {...}}], "services": [{"type": "BTService_DefaultFocus"}], "children": [ {"type": "MoveTo", "properties": {"AcceptableRadius": "50.0"}}, {"type": "Wait", "properties": {"WaitTime": "2.0"}} ] } ] }
Args: behavior_tree_name: Name of an EXISTING BT asset (create_behavior_tree first) tree: Root node JSON object (see format above) clear_existing: If True (default), remove all non-root nodes first
Returns: Dict with 'success', 'behavior_tree', 'nodes_created', 'nodes' list
KB: see knowledge_base/04_AI_SYSTEMS.md#overview Example: build_behavior_tree(behavior_tree_name="ExampleName", tree=[])
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tree | Yes | ||
| clear_existing | No | ||
| behavior_tree_name | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |