
How Behavior Trees work
The easiest way to think about the role that a Behavior Tree assumes within our AI Agent is to imagine it as a brain. It makes decisions and, as a consequence, acts on them. It is the processor for the artificial intelligence within our agent. Before we get started, if you have any experience with Behavior Trees in other contexts, it is important to understand that they differ in the context of Unreal.
It is, however, important to highlight one key difference here: Unreal Behavior Trees are read from the top to the bottom, and nodes will be executed from left to right. In other contexts, you might have found this to the other way around, in which the tree is read from left to right, and the nodes are executed from top to bottom.
If this is the first time you have encountered a Behavior Tree, then this will make sense when you read the next section.