Project Akemi - Prototype I | Field of View with Angle Checks

Hi, I’m new here and I’ve been interested in creating a stealth game.

So far I opened a new third person project in Unreal 5.5 and created a Blueprint Class: Character for an NPC.

The first thing I want to implement—as the title suggests—is to give the NPC a field of view by checking the angle between its forward vector and the players correct position.

So picture a ray, the starting end is the NPC’s current position, and the infinite end points to where the NPC is facing. Now place the player anywhere around the NPC, draw a line between them, and from these two lines find the smallest angle. If the angle is less then 90° the player is within the NPC’s FOV and the word “Spotted” should be printed as a string.

My goal is to create a working FOV for NPCs that runs logically.

To do it manually you’d use dot product - that’s your search keyword. However:

This whole thing is already implemented in the engine - neatly wrapped in this component:

https://www.youtube.com/results?search_query=ue5+pawn+sensing

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.