Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

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

1 comment

0

And I already know how to find closest player to an NPC, so I don't need help with that part.

1 answer

✓ Accepted answer

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.

This discussion is preserved as it was. New answers, comments, and votes are closed.