Enemy AI attack only when in front?

What causes the AI to attack the player when the pawn sensing is not directly looking at the player when its in the nearest distance?

In other words “When the AI is attacking it attacks no matter what direction”, how can I make the AI attack only when looking at the front?