Roblox Developer Logo Get Started Learn Roblox API Reference Community



Function of NavPath.pngPath
array<PathWaypoint> GetWaypoints ()

Returns: array<PathWaypoint>
Description: The GetWaypoints function returns an array of all the Lua error in Module:API at line 1723: Class "PathWaypoint" does not exist!.s in its Path. The array is arranged in the order of the waypoints in the path.

If a path was not able to be found, GetWaypoints will return an empty array.


local PathfindingService = game:GetService("PathfindingService")
local start =, 1, 0)
local finish =, 1, 25)
local path = PathfindingService:FindPathAsync(start, finish)
local waypoints = path:GetWaypoints() 
for waypointIndex, waypoint in pairs(waypoints) do
	print("Waypoint", waypointIndex, ":", waypoint.Position)