I wanted to make an NPC find a path to you, but only do it when you are in its line of sight, and ill use a raycast for it, and still look believable, to look like it is searching for you rather than the actual thing it's doing which is finding a path to you.
I can make the NPC wander, but how do I implement a line of sight based pathfinding system. I don't expect a code answer, but I want to know different ways I could look at it.
Two ways I thought of were:
Making the script just follow you for a certain wait time, and then switching to wander mode.
Somehow count the amount of turns its made. (Won't work in this particular games case since the npc is always facing you)
Which of these ways is better? Is there a different way I can approach it?

3 comments
I know how to raycast, I just want to know how to make it believable.
I put that in there... if you want some believable in-sight radius, i'd say something like if Unit:Dot(lookVector) > 0.2 then
no no, I mean the pathfinding believeable