add_bt_decorator
Attach an execution condition (decorator) to a BehaviorTree child edge so the runtime can gate whether that child runs; duplicate names are ignored.
Instructions
Attach a decorator (execution condition) to a specific child-edge of a BehaviorTree composite. The decorator is appended to that child's Decorators array and gates whether the child may run. Authoring is data-only: ParentNode/ExecutionIndex are assigned by the BT runtime at load (run_behavior_tree). Idempotent by decorator_name within the child-edge.
Returns: { behavior_tree_path: string, parent_name: string, child_name: string, decorator_name: string, decorator_class: string, already_exists: bool, decorator_count: int, saved: bool, save_error?: string }
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| child_name | Yes | Name of the existing child (a child_name from a prior add_bt_task_child/add_bt_composite_child) whose edge the decorator gates. | |
| parent_name | No | Optional parent composite name owning the child-edge; "Root" or omitted targets the RootNode. | |
| decorator_name | No | Optional stable name for the new decorator (its identity for idempotency); defaults to the decorator type. | |
| decorator_class | Yes | Concrete decorator class: "Cooldown" | "Loop" | "TimeLimit" | "Blackboard" | ... (or a BTDecorator_* class name). | |
| behavior_tree_path | Yes | Path to the UBehaviorTree asset (its RootNode must already be set, with the target child added). |