AI Perception Not Working

I’m trying to build a turret that tracks the player. I’ve tried a number of things and it still isn’t sensing my player. My player’s collision settings are:

  1. Generate overlap events and block events

  2. Collision enabled (Query and Physics)

  3. Collision response Block All.

My Turret:

  1. AIPerception component added

  2. Dominant Sense - AISense_Sight

There is a NavMesh on the map.

The turret’s blueprint just has an OnPerception Updated (AIPerception) connected to a print string.

I think I remember that the AI Perception is placed in the AI Controller, and then in the Pawn you need something else.

1 Like

Hi, two main reasons I can think of out of my head:

(-) Make sure you have detect neutrals enabled in your AI perception component (team is not implemented by default, everything is neutral and detection is set to detect hostiles only)

(-) Make sure that the pawns are either auto registering (default behavior unless you have disabled it/it has been disabled in your project), or that you add a perception stimuli source component to the player (or called something similar)

(-) And also as @DomusLudus said, the AI perception component should usually go into the controller, if you put it into the pawn it may not work correctly out of the box

Also you can use the AI debugger to debug it visually (see the vision range of the AI)