I made this as an example, I already have the moving NPCs part, I just don’t know how to make them choose between going left/right/straight when they meet a point, etc
You can simply add parts around your map where the npcs might walk to. Then you can use math.random() to select a random part. Then, make the NPC walk to that random part’s position using the information above(PathFindingService).
You could add invisible walls so the npcs would have to walk on the path. If you wanted to let players walk through them though, you could use Collision groups.
An alternative, which would take a long time, but would be more accurate, would be to place parts every few studs and use :MoveTo() to make the npcs walk to one of your points, using the parts.
I checked out the adjacency list from the solution and didn’t really understand it and I’m attempting to accomplish something similar to what you are trying to here. Did you ever get it working and how did you end up doing it?
I did the exact same thing back in 2015. Here is my free model of it: Paid Pathfinder Sytem - Roblox
(Hopefully it still works?)
Anyways, 6 years later I am working on customizable pathfinder written in Lua. It’ll be able to generate a nav mesh, but you’ll be able to throw in your custom waypoints as well. Feel free to join the community and follow the development. Any input would be appreciated. Polaris-Nav