Engine Class
Path
*เนื้อหานี้แปลโดยใช้ AI (เวอร์ชัน Beta) และอาจมีข้อผิดพลาด หากต้องการดูหน้านี้เป็นภาษาอังกฤษ ให้คลิกที่นี่
สรุป
คุณสมบัติ
วิธีการ
CheckOcclusionAsync(start: number):number |
ComputeAsync(start: Vector3,finish: Vector3):() |
เหตุการณ์
Blocked(blockedWaypointIdx: number):RBXScriptSignal |
Unblocked(unblockedWaypointIdx: number):RBXScriptSignal |
เอกสารอ้างอิงเกี่ยวกับ API
คุณสมบัติ
วิธีการ
CheckOcclusionAsync
ComputeAsync
GetPointCoordinates
GetWaypoints
ส่งค่ากลับ
ตัวอย่างโค้ด
รับพ้อยต์เส้นทาง
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เหตุการณ์
Unblocked