學習
引擎類別
Path
無法建立
未複製

*此內容是使用 AI(Beta 測試版)翻譯,可能含有錯誤。若要以英文檢視此頁面,請按一下這裡


概要
活動
Blocked(blockedWaypointIdx: number):RBXScriptSignal
Unblocked(unblockedWaypointIdx: number):RBXScriptSignal
繼承成員

API 參考
屬性
Status
唯讀
未複製
平行讀取
功能: Basic
Path.Status:Enum.PathStatus

方法
CheckOcclusionAsync
已棄用

ComputeAsync
暫停
功能: Basic
Path:ComputeAsync(
start:Vector3, finish:Vector3
):()
參數
start:Vector3
finish:Vector3
返回
()

GetPointCoordinates
已棄用

GetWaypoints
功能: Basic
Path:GetWaypoints():{any}
返回
範例程式碼
獲取路徑航點
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
end

活動
Blocked
功能: Basic
Path.Blocked(blockedWaypointIdx:number):RBXScriptSignal
參數
blockedWaypointIdx:number

Unblocked
功能: Basic
Path.Unblocked(unblockedWaypointIdx:number):RBXScriptSignal
參數
unblockedWaypointIdx:number

©2026 Roblox Corporation、Roblox、Roblox 標誌及 Powering Imagination 是我們在美國及其他國家地區的部分註冊與未註冊商標。