I've been working on a lot of attacking npcs recently and I've always wanted something like this but could never find an answer on how to make this work perfectly
COMMUNITY QUESTION
How can I make my npc move towards a player when its not being looked at?
1 answer
I recommend you use PathFinding,Check it out:
This discussion is preserved as it was. New answers, comments, and votes are closed.

3 comments
use a pathfinding script.
If you want to check if the player is looking at your NPC, I would start with getting the player's camera CFrame (this data can be spoofed by hackers - there is no way to get the actual), then figuring out the FOV and doing some math to figure out if the NPC is being seen. I'm pretty sure you know how to make it move...
this way is probably really un optomized but if i were you i'd create a giant invisible part that perfectly fills the characters screen and extends forwards and check if the part is being touched by the npc