PathWaypoint

Constructors

NameDescription
new(position: Vector3, action: Enum.PathWaypointAction, label: string)Creates a PathWaypoint at the given position with the given action and navigation area label.

Code Snippet

local PathfindingService = game:GetService("PathfindingService")

local path = PathfindingService:CreatePath()
path:ComputeAsync(humanoidRootPart.Position, targetPosition)

for _, waypoint in path:GetWaypoints() do
    if waypoint.Action == Enum.PathWaypointAction.Jump then
        humanoid.Jump = true
    end
    humanoid:MoveTo(waypoint.Position)
end

Properties

NameTypeDescription
PositionVector3The 3D position of this waypoint.
ActionEnum.PathWaypointActionThe action to perform at this waypoint.
LabelstringThe name of the navigation area that generated this waypoint. Automatic jump links have "Jump" as their label.