Pathfinding help

There is a mechanic I’d like to implement in my game, and it requires pathfinding. However, I’m not sure how to make it do specifically what I’d like.

Basically, I want an NPC to follow a specified and pre-determined path on a map. There is a part that is the base, and then there is the actual path which is separate from the base. I don’t want the NPC to be able to touch the base, only the path.

image

I’m not sure if FindPathAsync would be the best for this, but I’d like to avoid making extra parts that specify where the player should walk.

1 Like

You don’t need FindPathAsync for this, that function is for more variable and dynamic paths (for example, an npc chasing a player). Since your paths are pre-determined, you can store the nodes of your path. In your example image node1 would be where the npc is standing, node2 is the start of the second arrow, etc. etc.

1 Like