So, I'm trying to learn pathfinding but this does not work why? I just want it to create bricks between start point and the end point to soon make the npc follow them. And i don't have any errors the print("Creating...") just doesn't want to print.
Server Script:
local ps = game:GetService("PathfindingService") local pointmodel = workspace.Points function createPath(path) pointmodel:ClearAllChildren() local points = path:GetPointCoordinates() print("Starting to create..") for _, point in ipairs(points) do print("Creating...") 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 local Start = workspace.Start.Position local End = workspace.End.Position local p = ps:ComputeSmoothPathAsync(Start, End, 500) createPath(p) if p.Status == Enum.PathStatus.FailStartNotEmpty or p.Status == Enum.PathStatus.FailFinishNotEmpty then print("Compute failed") return {} end return p:GetPointCoordinates()