Now, it is time to attach this behavior tree to the Enemy’s BT executor. For that, follow these steps:
- Select the Enemy game object and add the Behavior Executor component to it.
- In the Behavior field, drag and drop the behavior tree we created before.
- In Behavior Parameters, a list of all the blackboard parameters we defined in the previous step (player, floor, shootPoint, and bullet) should appear.
- Fill them with the appropriate objects, as shown in the following screenshot:
- At this point, the enemy should be ready to go. Click play and you should see the enemy wandering around and, when close enough to the ...