To create an attack task that does damage, we will extend the Attack Player sequence we created in the enemy Behavior Tree. Open EnemyBehavior from Content Browser. From the Behavior Tree view, click on the New Task button and select the BTTask_BlueprintBase option from the drop-down menu that appears. As we did with the custom task to reset key values in Chapter 9, Building Smart Enemies with Artificial Intelligence, we will navigate to the Enemy folder in Content Browser and rename the newly created BTTask_BlueprintBase_New object to DoAttackTask. Double-click on DoAttackTask to return to Event Graph for the new task.
We will need to create two variables within the task, one to store the target of the damage, and one ...