PathWaypoint

顯示已棄用項目

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

PathWaypoint 動作動、Enum.PathWaypointAction 位置和 Vector3 標籤構成的 string 數據類型,由 PathfindingService 用於在生成的路徑上創建點數。

下面的代碼方塊構建了一個 PathWaypoint 變量,其位置為 Vector3.new(10, 10, 10) ,行動作為 Enum.PathWaypointAction.Walk ,標籤為 Custom Label


local pos = Vector3.new(10, 10, 10)
local waypoint = PathWaypoint.new(pos, Enum.PathWaypointAction.Walk, "Custom Label")

PathWaypoint也可以通過傳遞位置和動作來構建。標籤屬性將以空字串的形式設為默認值。


local pos = Vector3.new(10, 10, 10)
local waypoint = PathWaypoint.new(pos, Enum.PathWaypointAction.Walk)

行動

描述達到此路徑點的行動,可設為下列枚值之一:


<th>值</th>
<th>說明</th>
</tr>
</thead>
<tbody>
<tr>
<td>
步行
</td>
<td>0</td>
<td>
需要走動行動才能從前一個路點到達這個路點。
</td>
</tr>
<tr>
<td>
</td>
<td>1</td>
<td>
需要跳躍行動才能從前一個路點到達這個路點。
</td>
</tr>
</tbody>
名稱

概要

建構子

屬性

建構子

new

從指定的 PathWaypoint 位置、Vector3 動作和可選字串標籤返回一個 Enum.PathWaypointAction 對象,以及可選的字串標籤。

參數

position: Vector3

路點的 3D 位置。

預設值:Vector3.new(0, 0, 0)

在路點執行的行動。

預設值:Enum.PathWaypointAction.Walk
label: string

產生路徑點的導航區名稱。

屬性

在此路點執行的行動。

Position

此路點的 3D 位置。

Label

產生此路點的導航區域名稱。您可以使用 PathwayPoint.Label 來決定使用到達路徑點的自訂行動。徑找修改器和材料各有一個標籤。自動跳轉鏈接的標籤為「跳躍」。