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.