O'Reilly logo

Blueprints Visual Scripting for Unreal Engine by Brenden Sewell

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Making the AI chase the player

Now that we have a patrol behavior established, we should make the enemy pose some threat to the player. To do so, we will give the enemy the ability to see the player and pursue them.

Giving the enemy sight with Pawn Sensing

To grant the enemy the ability to detect the player, we need to add a PawnSensing component to the EnemyController. To do this, open the EnemyController Blueprint and click on the Add Component button in the Components panel. Search for and add the PawnSensing component. This component gives us the ability to add a few additional event triggers to the EnemyController event graph. The one we are interested in now is called OnSeePawn (PawnSensing), as shown here:

Note

There is a second system that ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required