由 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(position : Vector3,action : Enum.PathWaypointAction,label : string)
從指定的 PathWaypoint 位置、Vector3 動作和可選字串標籤返回一個 Enum.PathWaypointAction 對象,以及可選的字串標籤。
建構子
new
從指定的 PathWaypoint 位置、Vector3 動作和可選字串標籤返回一個 Enum.PathWaypointAction 對象,以及可選的字串標籤。
參數
路點的 3D 位置。
在路點執行的行動。
產生路徑點的導航區名稱。