Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to make NPC follow player but also follow a path?

Asked by 4 years ago

Kind of like guard in the game Notoriety, they follow players and shoot them, but they don't get stuck on walls because they follow a path to get there.

I was thinking a script to see which path part the player is the closest to, then follow other paths to get there. But I don't know how to find distance between parts and players so I need help.

Thanks

0
And I already know how to find closest player to an NPC, so I don't need help with that part. AlexanderYar 788 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

There is always PathfindingService which allows for this exact behaviour. There is an article here that explains it. If you wish for me to explain it just comment on my answer and I will do so.

Ad

Answer this question