A Top-Down Game with Blueprints 609
2. Double-click on the AI folder you just created to go into it.
3. Inside this new folder w e need to create a new Behavior Tree and a new Black-
board. To do this, per form the following tasks:
a. Right-click in the AI folder and choose
New->Miscellaneous->Behavior Tree.
b. Right-click in the AI folder again and select
New->Miscellaneous->Blackboard.
c. Name your Behavior Tree EnemyBT a nd your Blackboard Enemy BB.
4. Now, we need to create a new blueprin t for the Enemy Controller. Perform the
following ta sks:
a. When creating this blue print, click All C lasses.
b. Search for AI Controller and select it as the base-class (see Fig-
ure 9.40(a)).
c. Name this class blueprint Enemy Controller.
5. Now, go bac k to the main editor and search for Nav Mesh Bounds Volume in
the search bar un der the Modes tab.
6. Drag the Nav Mesh Bounds Volume onto the scene.
7. Change the scale of the volume to be roughly th e same size as our arena . Re-
member that the size of our arena was X: 3000, Y: 3000, Z:200. I suggest using
values like X:3200, Y:3200, and Z:300 fo r the size of your Nav Mesh Bounds
Volume.
8. Press the P key to see the Nav Mesh coverage on the scene. It will show up as a
green area.
9. Align the Nav Mesh Bounds Volume so it covers the entire ground of the level
(see Figure 9.40(b)). Note: I t’s okay if it goes through walls a bit as the enemies
will collide with the wall anyway.
10. Open u p the behavior tree we created earlier by double-clicking it.
11. Make sure that in the Details rollout of the behavior tree, the Blackboard
Asset is set to the EnemyBB we created earlier in step (3c).
12. Go into the event graph of the Enemy Controller we ju st crea te d in step 4.
13. Create a new Event Begin Play node.
14. Drag a wire off of the Event Begin Play and place a Run Behavior Tree
node.
15. Set the BTAsset channel of the Run Behavior Tree to our created Enemy B T
behavior tree in step (3 a). You can click on the drop-down section and search for
the behavior tre e.
16. Compile and save your Enemy Controller bluep rint.
17. Now, we will set up the AI controller of our Enemy class. Perform the following
tasks:
a. Open the Enemy blueprint.
b. Click o n the Defaults mode of the En emy blueprint.
c. Scroll down to the AI section and change the AIController class to our
created Enemy Controller (see Figure 9.40(c) ).
18. Compile and save the Enemy blueprint.