I am trying to learn pathfinding service, and have done well I feel. However; I wish to know how to make the AI actually follow a set path. Currently, the AI can move from one part to another easily, but does not follow a set path. It just does what it must to get there. Here is the code:
local PFS = game:GetService(‘PathfindingService’)
local zombie = game.Workspace.Zombie
local humanoid = zombie.Humanoid
local destination = game.Workspace.End
Path finding Service singleton does not follow a preset path, it simply finds the shortest path possible if that answers your question. If you want to create a specific path, like in cut scenes, you’ll have to make a path manually if I’m not wrong
PathfindingService creates a set of waypoints for you to cycle through to properly move a character from one point or another. If you want to use a preset path, PathfindingService is irrelevant. Simply replace the waypoints generated from the PathfindingService with the waypoints you want to use for your preset path.
If you’re looking to make a repeated path, like a guard for example, patroling an area, you could create your own path following simply creating your own nodes with parts, and have the guards humanoid moveto target the first node and cycle through all nodes until it reaches its last node, and repeat.