navmesh-setting

【技巧倉庫】套用NavMesh設定玩家walkable地方

套用NavMesh 設定玩家walkable地方

 

步驟: 

(1) 選取地形的物件 (可選多於一個)。

(2) 在Navigation Window, 選 "Object" 按鈕, Check下 "Navigation Static"。計算Nav Mesh的物件必需是Static。

navmesh-setting03 

(3) 在Navigation Window, 選 "Bake" 按鈕, 輸入所需的設定值。以下是Unity官方網頁對設定值的說明

  • Agent Radius defines how close the agent center can get to a wall or a ledge.
  • Agent Height defines how low the spaces are that the agent can reach.
  • Max Slope defines how steep the ramps are that the agent walk up.
  • Step Height defines how high obstructions are that the agent can step on.

navmesh-setting04 

(4) 按" Bake"

(5) 計算後的"NavMesh"會以藍色呈現。"Save Scene"作儲存。

 

參考: https://docs.unity3d.com/Manual/Navigation.html