O'Reilly logo

Unreal Engine 4 Scripting with C++ Cookbook by Stephen Whittle, William Sherif

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Connecting a Behavior Tree to a Character

A BehaviorTree chooses a behavior to be exhibited by an AI-controlled unit at any given moment in time. Behavior Trees are relatively simple to construct, but there is a lot of setting up to do to get one running. You also have to be familiar with the components available for constructing your Behavior Tree to do so effectively.

A Behavior Tree is extremely useful for defining NPC behavior that is more varied than simply moving towards an opponent (as shown in the previous recipe with AIMoveTo).

Getting ready

The process of setting up a Behavior Tree to control a character is fairly complicated. The first thing we need is a Blueprint of a Character class derivative to control. We then need to create a custom ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required