Up to date

This page is up to date for Godot 4.2. If you still find outdated information, please open an issue.

使用 NavigationAgent

NavigationsAgents 是輔助節點,它結合了 Node2D/3D 繼承父節點的尋路、路徑追蹤和代理迴避功能。對於初學者來說,它們以更方便的方式代表父參與者節點促進對 NavigationServer API 的常見呼叫。

2D 和 3D 版本的 NavigationAgent 分別可用作:ref:NavigationAgent2D<class_NavigationAgent2D> 和:ref:NavigationAgent3D<class_NavigationAgent3D>

New NavigationAgent nodes will automatically join the default navigation map on the World2D/World3D.

NavigationsAgent 節點是可選的,並不是使用導覽系統的硬性需求。它們的全部功能可以替換為腳本和對 NavigationServer API 的直接呼叫。