I have a function set up to make a NPC walk towards a point using pathfinding, however after trying to make an NPC walk towards me, it tells me that the path status is "NoPath".
Here is my code:
local PathFindingService = game:GetService("PathfindingService")
local function WalkToPoint(Humanoid, Start, WalkTo, MaxDistance)
if Humanoid and Humanoid:GetState() ~= Enum.HumanoidStateType.Dead then
local Start = Start
local Path = PathFindingService:FindPathAsync(Start, WalkTo, MaxDistance)
print(Path.Status)
if Path.Status == Enum.PathStatus.Success then
for i, v in pairs(Path:GetWayPoints()) do
print("Moving to point:", v.Position)
Humanoid:MoveTo(v.Position)
Humanoid.MoveToFinished:Wait()
if v.Action == Enum.PathWaypointAction.Jump then
Humanoid.Jump = true
end
end
end
end
end
