Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Path.Status says Enum.PathStatus.NoPath why?

Asked by 5 years ago

local pathfindingService = game:GetService("PathfindingService") local pointModel = Instance.new("Model") pointModel.Name = "Points" pointModel.Parent = game.Workspace function visualizePath(path) -- clear old path visualization pointModel:ClearAllChildren() -- calculate new visualization local points = path:GetPointCoordinates() for _, point in ipairs(points) do local part = Instance.new("Part") part.FormFactor = Enum.FormFactor.Custom part.Size = Vector3.new(1,1,1) part.Position = point part.Anchored = true part.CanCollide = false part.Parent = pointModel end end function GetPath () local start = game.Workspace.Start.Position local target = game.Workspace.End.Position local path = pathfindingService:ComputeRawPathAsync(start, target, 500) visualizePath(path) -- Check to see if the path was computed correctly print (path.Status) if path.Status == Enum.PathStatus.FailStartNotEmpty or path.Status == Enum.PathStatus.FailFinishNotEmpty then print("Compute failed") return {} end return path:GetPointCoordinates() end wait () while true do wait (9) GetPath() end
0
Be more descriptive on the problem and what you have tried, you pretty much just pasted in a whole script for us and expected us to solve the problem. Warfaresh0t 414 — 5y
0
You are also using deprecated items, those being ComputeRawPathAsync and FormFactorPart.FormFactor User#19524 175 — 5y
0
Well read it: Enum.PathStatus.NoPath. No path was found. You are also using deprecated pathfinding service functions. Optikk 499 — 5y

Answer this question