How do I limit line trace pawn's view cone?

I have a “guard” pawn that needs to be tracing for the player (Basic stealth game-type pawn). But I need him to only be able to ‘see’ the player if the player is in the natural view cone of the pawn. I have found a few threads about using the pawns rotation or forward vector, but I cant figure out how to control how wide a view the pawn would have. Any help on this would be awesome!

Here you go - I just finished putting together this tutorial, the first thing I do in it is create a cone of vision for the AI, so it should give you exactly what you want.

You will then want to use a raycheck to check that the AI's target is not being obscured. I will be covering this in the next tutorial I make so feel free to wait for that!

Thank you so much! I’m gonna give this a try :slight_smile: