Creating an enemy attack
If the enemies we create are going to pose a real obstacle that stand in the way of the player achieving the goals we create for them, we will first need to give the enemies the ability to damage the player. In the previous chapter, we set up the basic structure of an enemy attack pattern. It is triggered when the player enters the enemy's line of sight. We are now going to introduce a damage component to this attack, ensuring that there is some consequence of the enemy reaching melee range of the player.
Making an attack task
To create an attack task that does damage, we will be extending the Attack Player
sequence we created in the enemy Behavior Tree. Open EnemyBehavior from Content Browser now. 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 the previous chapter, we will want to navigate to the Enemy folder in Content...