Lua error in Module:API at line 338: attempt to index local 'class' (a nil value).
This example creates a path between two points and creates parts at every waypoint along that path. The code uses the Position property of the PathWaypoints to position the parts.
-- Make variables for Roblox services local PathfindingService = game:GetService("PathfindingService") -- Make variables for the start and end of the path local start = Vector3.new(0, 1, 0) local finish = Vector3.new(25, 1, -60) -- Find the path and get the waypoints local path = PathfindingService:FindPathAsync(start, finish) local waypoints = path:GetWaypoints() -- Loop through all of the waypoints in the path for waypointIndex, waypoint in pairs(waypoints) do -- Create a part for each waypoint and position the part -- at the waypoint's position. local part = Instance.new("Part") part.Size = Vector3.new(1, 1, 1) part.Position = waypoint.Position part.CanCollide = false part.Anchored = true part.Parent = game.Workspace end