[UE4, C++] AI Sight Perception problem - Enemy won't detect player and is trying to go outside the map!

Unfortunately, I cannot compile your code due to the external dependencies so You need to debug your code yourself.

So the mistake can be caused by these points:

  • You don’t check that UpdatedActors[i] == Player before moving. As the result, AI moves to the latest spotted pawn which is likely not the player if you have ~60 pawns

  • Your enemy is trying to leave the map because you tell him to do so in Tick().
    But you did not tell him when to stop moving.

If these two things are not the problem, please describe what is exactly wrong and what behavior you are expecting. Also, it’d be nice if you could provide the link to the whole project so I can launch it on my computer.