Engine Class
Path
Summary
Properties
Methods
CheckOcclusionAsync(start: number):number |
ComputeAsync(start: Vector3,finish: Vector3):() |
Events
Blocked(blockedWaypointIdx: number):RBXScriptSignal |
Unblocked(unblockedWaypointIdx: number):RBXScriptSignal |
API Reference
Properties
Methods
CheckOcclusionAsync
ComputeAsync
GetPointCoordinates
GetWaypoints
Returns
Code Samples
Get Path Waypoints
local PathfindingService = game:GetService("PathfindingService")
local path = PathfindingService:CreatePath()
local PATH_START = Vector3.new(0, 1, 0)
local PATH_END = Vector3.new(100, 1, 25)
path:ComputeAsync(PATH_START, PATH_END)
if path.Status == Enum.PathStatus.Success then
local waypoints = path:GetWaypoints()
for _, waypoint in pairs(waypoints) do
print(waypoint.Position)
end
endEvents
Unblocked