Switch External Behavior Trees

Goal

Use External Behavior Trees when several agents share high-level logic but need different reusable behavior assets for a role, loadout, or situation.

Tree structure

Use a Selector with one Sequence per role. Put a role Conditional first and a Behavior Tree Reference Action second. Add the default role as the final fallback.

A Selector chooses a combat or civilian external behavior tree according to the current role.

How it runs

Create and test each External Behavior Tree independently. Assign the appropriate asset to each Behavior Tree Reference and map its exposed variables by purpose. The Selector chooses the first valid role branch, then the reference runs the external tree and reports its result.

Use the Behavior Tree component’s External Behavior field instead when the whole component always runs one asset and code should replace that asset before execution.

Variations

Keep all role assets compatible with the variables supplied by the parent. Split large shared sections into another External Behavior Tree rather than copying them.

Tasks used in this tree

Selector, Sequence, Behavior Tree Reference from Actions, and External Behavior Trees.