Creating a chasing behavior

Now, we need to create a series of task nodes underneath the Attack Player sequence that will make up the enemy's chasing behavior. Because we already have Blackboard Key that stores the player Actor, including its location data, moving the enemy character to the player is easy. Drag a wire from the Attack Player sequence node and attach it to a Move To task node. Click on this node, and in the Details panel, change Blackboard Key to PlayerActor.

That's all that is necessary to get the enemy chasing the player! You can compile, save, and press Play to test-run this behavior. When you run in front of the enemy on its patrol path, it will break out of its path and begin pursuing you around the Level. However, you ...

Get Blueprints Visual Scripting for Unreal Engine - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.