
The AI Controller to run a Behavior Tree
The next step is to run the Behavior Tree from an AI Controller. Usually, this is an easy task that it is implemented in Blueprint (in which it is possible to directly refer to a specific Behavior Tree). Even if we have a complex C++ AI Controller, we can extend the controller in Blueprint and Run the Behavior Tree from Blueprint. In any case, if a hard reference doesn't work (e.g. you are using C++ or because you want to have more flexibility), then you can store the Behavior Tree in the Character/Pawn that needs to run that specific Behavior Tree, and retrieve it when the AI Controller possesses the Pawn.
Let's explore how we can do this both in Blueprint (we will reference the Behavior Tree in a variable, in which we can decide on the default value) and in C++ (in which we will store the Behavior Tree in the Character).