NPC that will investigate

Hello Roblox Devs,

I am trying to make an NPC kind of like the Fortnite henchman.

I want the Npc to:

  • have a fov and when a player enters it, the npc will walk to about 20 studs from the player
  • have a larger fov such as 120 and if a player enters it the npc will go and investigate the movement it saw

I already have an Idea on what I can do for detecting nearby sounds:

Subtract sound area position and npc position then magnitude it to get distance. If the distance is less then so and so then the npc will investigate it

I also want to have the npc to have a gun but I think ill make a separate topic for that.

How would ai approach this task?

GnomeCode on YT has a good tutorial on how he made his AI which checks if it can ‘see’ a target.

I hope this posts help you, make sure you searched for a post to prevent making an already existing post.

Yes, you were right, you can also use workspace:GetPartsBoundInRadius(Position, Radius OverlapParams).

This is the same thing as the first task, you can set variables like “InvestigateDistance” and “IdentifyDistance”.

If you want, you can send me a private message and we can talk about this system. (This is something I tried to do too)