# How to change Behavior Tree at runtime?

**URL:** <https://forums.unrealengine.com/t/how-to-change-behavior-tree-at-runtime/765825>\
**Category:** C++\
**Tags:** Behavior-Tree, run-behavior, ai-controller, unreal-engine, CPP\
**Created:** [February 7, 2023, 7:07pm UTC](https://forums.unrealengine.com/t/how-to-change-behavior-tree-at-runtime/765825 "2023-02-07T19:07:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ad04a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ad04a](https://forums.unrealengine.com/u/Ad04a)\
**Post date:** [February 7, 2023, 7:07pm UTC](https://forums.unrealengine.com/t/how-to-change-behavior-tree-at-runtime/765825/1 "2023-02-07T19:07:46Z")

</div>

I am currently developing kind of city builder on c++. I am trying to recreate MC mod - MineColonies. I have an AI controlled characters with profession. Every profession needs to do different things. So I am wondering if there is a way to change given controller’s Behavior Tree at runtime. Or change the controller itself. If this is not possible may i ask for recommendations on for the realization of different “behaviors”

---

<div class="post-metadata">

**Author:** ![Detach789](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Detach789](https://forums.unrealengine.com/u/Detach789)\
**Post date:** [February 7, 2023, 7:36pm UTC](https://forums.unrealengine.com/t/how-to-change-behavior-tree-at-runtime/765825/2 "2023-02-07T19:36:19Z")

</div>

I have no idea how to do this with pure C++, but if you don’t mind using a Blueprint Implementable Event, I believe the [Run Behavior Tree](https://docs.unrealengine.com/5.1/en-US/BlueprintAPI/AI/RunBehaviorTree/) node will replace the behavior tree of a controller for you.
