class_navigationagent.rst 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/3.6/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/3.6/doc/classes/NavigationAgent.xml.
  6. .. _class_NavigationAgent:
  7. NavigationAgent
  8. ===============
  9. **Inherits:** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  10. 3D agent used in navigation for collision avoidance.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. 3D agent that is used in navigation to reach a location while avoiding static and dynamic obstacles. The dynamic obstacles are avoided using RVO (Reciprocal Velocity Obstacles) collision avoidance. The agent needs navigation data to work correctly. By default this node will register to the default :ref:`World<class_World>` navigation map. If this node is a child of a :ref:`Navigation<class_Navigation>` node it will register to the navigation map of the navigation node or the function :ref:`set_navigation<class_NavigationAgent_method_set_navigation>` can be used to set the navigation node directly. **NavigationAgent** is physics safe.
  15. \ **Note:** After setting :ref:`target_location<class_NavigationAgent_property_target_location>` it is required to use the :ref:`get_next_location<class_NavigationAgent_method_get_next_location>` function once every physics frame to update the internal path logic of the NavigationAgent. The returned vector position from this function should be used as the next movement position for the agent's parent Node.
  16. \ **Note:** By default, the expensive calculations for avoidance are done in a thread. In HTML5 exports without thread support, they will be done on the main thread, which can lead to performance issues.
  17. .. rst-class:: classref-reftable-group
  18. Properties
  19. ----------
  20. .. table::
  21. :widths: auto
  22. +-------------------------------+----------------------------------------------------------------------------------------+------------------------+
  23. | :ref:`float<class_float>` | :ref:`agent_height_offset<class_NavigationAgent_property_agent_height_offset>` | ``0.0`` |
  24. +-------------------------------+----------------------------------------------------------------------------------------+------------------------+
  25. | :ref:`bool<class_bool>` | :ref:`avoidance_enabled<class_NavigationAgent_property_avoidance_enabled>` | ``false`` |
  26. +-------------------------------+----------------------------------------------------------------------------------------+------------------------+
  27. | :ref:`bool<class_bool>` | :ref:`ignore_y<class_NavigationAgent_property_ignore_y>` | ``true`` |
  28. +-------------------------------+----------------------------------------------------------------------------------------+------------------------+
  29. | :ref:`int<class_int>` | :ref:`max_neighbors<class_NavigationAgent_property_max_neighbors>` | ``10`` |
  30. +-------------------------------+----------------------------------------------------------------------------------------+------------------------+
  31. | :ref:`float<class_float>` | :ref:`max_speed<class_NavigationAgent_property_max_speed>` | ``10.0`` |
  32. +-------------------------------+----------------------------------------------------------------------------------------+------------------------+
  33. | :ref:`int<class_int>` | :ref:`navigation_layers<class_NavigationAgent_property_navigation_layers>` | ``1`` |
  34. +-------------------------------+----------------------------------------------------------------------------------------+------------------------+
  35. | :ref:`float<class_float>` | :ref:`neighbor_dist<class_NavigationAgent_property_neighbor_dist>` | ``50.0`` |
  36. +-------------------------------+----------------------------------------------------------------------------------------+------------------------+
  37. | :ref:`float<class_float>` | :ref:`path_desired_distance<class_NavigationAgent_property_path_desired_distance>` | ``1.0`` |
  38. +-------------------------------+----------------------------------------------------------------------------------------+------------------------+
  39. | :ref:`float<class_float>` | :ref:`path_max_distance<class_NavigationAgent_property_path_max_distance>` | ``3.0`` |
  40. +-------------------------------+----------------------------------------------------------------------------------------+------------------------+
  41. | :ref:`float<class_float>` | :ref:`radius<class_NavigationAgent_property_radius>` | ``1.0`` |
  42. +-------------------------------+----------------------------------------------------------------------------------------+------------------------+
  43. | :ref:`float<class_float>` | :ref:`target_desired_distance<class_NavigationAgent_property_target_desired_distance>` | ``1.0`` |
  44. +-------------------------------+----------------------------------------------------------------------------------------+------------------------+
  45. | :ref:`Vector3<class_Vector3>` | :ref:`target_location<class_NavigationAgent_property_target_location>` | ``Vector3( 0, 0, 0 )`` |
  46. +-------------------------------+----------------------------------------------------------------------------------------+------------------------+
  47. | :ref:`float<class_float>` | :ref:`time_horizon<class_NavigationAgent_property_time_horizon>` | ``5.0`` |
  48. +-------------------------------+----------------------------------------------------------------------------------------+------------------------+
  49. .. rst-class:: classref-reftable-group
  50. Methods
  51. -------
  52. .. table::
  53. :widths: auto
  54. +-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
  55. | :ref:`float<class_float>` | :ref:`distance_to_target<class_NavigationAgent_method_distance_to_target>` **(** **)** |const| |
  56. +-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
  57. | :ref:`Vector3<class_Vector3>` | :ref:`get_final_location<class_NavigationAgent_method_get_final_location>` **(** **)** |
  58. +-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
  59. | :ref:`PoolVector3Array<class_PoolVector3Array>` | :ref:`get_nav_path<class_NavigationAgent_method_get_nav_path>` **(** **)** |const| |
  60. +-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
  61. | :ref:`int<class_int>` | :ref:`get_nav_path_index<class_NavigationAgent_method_get_nav_path_index>` **(** **)** |const| |
  62. +-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
  63. | :ref:`Node<class_Node>` | :ref:`get_navigation<class_NavigationAgent_method_get_navigation>` **(** **)** |const| |
  64. +-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
  65. | :ref:`RID<class_RID>` | :ref:`get_navigation_map<class_NavigationAgent_method_get_navigation_map>` **(** **)** |const| |
  66. +-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
  67. | :ref:`Vector3<class_Vector3>` | :ref:`get_next_location<class_NavigationAgent_method_get_next_location>` **(** **)** |
  68. +-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
  69. | :ref:`RID<class_RID>` | :ref:`get_rid<class_NavigationAgent_method_get_rid>` **(** **)** |const| |
  70. +-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
  71. | :ref:`bool<class_bool>` | :ref:`is_navigation_finished<class_NavigationAgent_method_is_navigation_finished>` **(** **)** |
  72. +-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
  73. | :ref:`bool<class_bool>` | :ref:`is_target_reachable<class_NavigationAgent_method_is_target_reachable>` **(** **)** |
  74. +-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
  75. | :ref:`bool<class_bool>` | :ref:`is_target_reached<class_NavigationAgent_method_is_target_reached>` **(** **)** |const| |
  76. +-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
  77. | void | :ref:`set_navigation<class_NavigationAgent_method_set_navigation>` **(** :ref:`Node<class_Node>` navigation **)** |
  78. +-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
  79. | void | :ref:`set_navigation_map<class_NavigationAgent_method_set_navigation_map>` **(** :ref:`RID<class_RID>` navigation_map **)** |
  80. +-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
  81. | void | :ref:`set_velocity<class_NavigationAgent_method_set_velocity>` **(** :ref:`Vector3<class_Vector3>` velocity **)** |
  82. +-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
  83. .. rst-class:: classref-section-separator
  84. ----
  85. .. rst-class:: classref-descriptions-group
  86. Signals
  87. -------
  88. .. _class_NavigationAgent_signal_navigation_finished:
  89. .. rst-class:: classref-signal
  90. **navigation_finished** **(** **)**
  91. Notifies when the final location is reached.
  92. .. rst-class:: classref-item-separator
  93. ----
  94. .. _class_NavigationAgent_signal_path_changed:
  95. .. rst-class:: classref-signal
  96. **path_changed** **(** **)**
  97. Notifies when the navigation path changes. This can be triggered by the navigation system or by the user changing the path.
  98. .. rst-class:: classref-item-separator
  99. ----
  100. .. _class_NavigationAgent_signal_target_reached:
  101. .. rst-class:: classref-signal
  102. **target_reached** **(** **)**
  103. Notifies when the player-defined :ref:`target_location<class_NavigationAgent_property_target_location>` is reached.
  104. .. rst-class:: classref-item-separator
  105. ----
  106. .. _class_NavigationAgent_signal_velocity_computed:
  107. .. rst-class:: classref-signal
  108. **velocity_computed** **(** :ref:`Vector3<class_Vector3>` safe_velocity **)**
  109. Notifies when the collision avoidance velocity is calculated after a call to :ref:`set_velocity<class_NavigationAgent_method_set_velocity>`. Only emitted when :ref:`avoidance_enabled<class_NavigationAgent_property_avoidance_enabled>` is true.
  110. .. rst-class:: classref-section-separator
  111. ----
  112. .. rst-class:: classref-descriptions-group
  113. Property Descriptions
  114. ---------------------
  115. .. _class_NavigationAgent_property_agent_height_offset:
  116. .. rst-class:: classref-property
  117. :ref:`float<class_float>` **agent_height_offset** = ``0.0``
  118. .. rst-class:: classref-property-setget
  119. - void **set_agent_height_offset** **(** :ref:`float<class_float>` value **)**
  120. - :ref:`float<class_float>` **get_agent_height_offset** **(** **)**
  121. The NavigationAgent height offset is subtracted from the y-axis value of any vector path position for this NavigationAgent. The NavigationAgent height offset does not change or influence the navigation mesh or pathfinding query result. Additional navigation maps that use regions with navigation meshes that the developer baked with appropriate agent radius or height values are required to support different-sized agents.
  122. .. rst-class:: classref-item-separator
  123. ----
  124. .. _class_NavigationAgent_property_avoidance_enabled:
  125. .. rst-class:: classref-property
  126. :ref:`bool<class_bool>` **avoidance_enabled** = ``false``
  127. .. rst-class:: classref-property-setget
  128. - void **set_avoidance_enabled** **(** :ref:`bool<class_bool>` value **)**
  129. - :ref:`bool<class_bool>` **get_avoidance_enabled** **(** **)**
  130. If ``true`` the agent is registered for an RVO avoidance callback on the :ref:`NavigationServer<class_NavigationServer>`. When :ref:`set_velocity<class_NavigationAgent_method_set_velocity>` is used and the processing is completed a ``safe_velocity`` Vector3 is received with a signal connection to :ref:`velocity_computed<class_NavigationAgent_signal_velocity_computed>`. Avoidance processing with many registered agents has a significant performance cost and should only be enabled on agents that currently require it.
  131. .. rst-class:: classref-item-separator
  132. ----
  133. .. _class_NavigationAgent_property_ignore_y:
  134. .. rst-class:: classref-property
  135. :ref:`bool<class_bool>` **ignore_y** = ``true``
  136. .. rst-class:: classref-property-setget
  137. - void **set_ignore_y** **(** :ref:`bool<class_bool>` value **)**
  138. - :ref:`bool<class_bool>` **get_ignore_y** **(** **)**
  139. Ignores collisions on the Y axis. Must be ``true`` to move on a horizontal plane.
  140. .. rst-class:: classref-item-separator
  141. ----
  142. .. _class_NavigationAgent_property_max_neighbors:
  143. .. rst-class:: classref-property
  144. :ref:`int<class_int>` **max_neighbors** = ``10``
  145. .. rst-class:: classref-property-setget
  146. - void **set_max_neighbors** **(** :ref:`int<class_int>` value **)**
  147. - :ref:`int<class_int>` **get_max_neighbors** **(** **)**
  148. The maximum number of neighbors for the agent to consider.
  149. .. rst-class:: classref-item-separator
  150. ----
  151. .. _class_NavigationAgent_property_max_speed:
  152. .. rst-class:: classref-property
  153. :ref:`float<class_float>` **max_speed** = ``10.0``
  154. .. rst-class:: classref-property-setget
  155. - void **set_max_speed** **(** :ref:`float<class_float>` value **)**
  156. - :ref:`float<class_float>` **get_max_speed** **(** **)**
  157. The maximum speed that an agent can move.
  158. .. rst-class:: classref-item-separator
  159. ----
  160. .. _class_NavigationAgent_property_navigation_layers:
  161. .. rst-class:: classref-property
  162. :ref:`int<class_int>` **navigation_layers** = ``1``
  163. .. rst-class:: classref-property-setget
  164. - void **set_navigation_layers** **(** :ref:`int<class_int>` value **)**
  165. - :ref:`int<class_int>` **get_navigation_layers** **(** **)**
  166. A bitfield determining all navigation map layers the **NavigationAgent** belongs to. On path requests the agent will ignore navmeshes without at least one matching layer.
  167. .. rst-class:: classref-item-separator
  168. ----
  169. .. _class_NavigationAgent_property_neighbor_dist:
  170. .. rst-class:: classref-property
  171. :ref:`float<class_float>` **neighbor_dist** = ``50.0``
  172. .. rst-class:: classref-property-setget
  173. - void **set_neighbor_dist** **(** :ref:`float<class_float>` value **)**
  174. - :ref:`float<class_float>` **get_neighbor_dist** **(** **)**
  175. The distance to search for other agents.
  176. .. rst-class:: classref-item-separator
  177. ----
  178. .. _class_NavigationAgent_property_path_desired_distance:
  179. .. rst-class:: classref-property
  180. :ref:`float<class_float>` **path_desired_distance** = ``1.0``
  181. .. rst-class:: classref-property-setget
  182. - void **set_path_desired_distance** **(** :ref:`float<class_float>` value **)**
  183. - :ref:`float<class_float>` **get_path_desired_distance** **(** **)**
  184. The distance threshold before a path point is considered to be reached. This will allow an agent to not have to hit a path point on the path exactly, but in the area. If this value is set to high the NavigationAgent will skip points on the path which can lead to leaving the navigation mesh. If this value is set to low the NavigationAgent will be stuck in a repath loop cause it will constantly overshoot or undershoot the distance to the next point on each physics frame update.
  185. .. rst-class:: classref-item-separator
  186. ----
  187. .. _class_NavigationAgent_property_path_max_distance:
  188. .. rst-class:: classref-property
  189. :ref:`float<class_float>` **path_max_distance** = ``3.0``
  190. .. rst-class:: classref-property-setget
  191. - void **set_path_max_distance** **(** :ref:`float<class_float>` value **)**
  192. - :ref:`float<class_float>` **get_path_max_distance** **(** **)**
  193. The maximum distance the agent is allowed away from the ideal path to the final location. This can happen due to trying to avoid collisions. When the maximum distance is exceeded, it recalculates the ideal path.
  194. .. rst-class:: classref-item-separator
  195. ----
  196. .. _class_NavigationAgent_property_radius:
  197. .. rst-class:: classref-property
  198. :ref:`float<class_float>` **radius** = ``1.0``
  199. .. rst-class:: classref-property-setget
  200. - void **set_radius** **(** :ref:`float<class_float>` value **)**
  201. - :ref:`float<class_float>` **get_radius** **(** **)**
  202. The radius of the avoidance agent. This is the "body" of the avoidance agent and not the avoidance maneuver starting radius (which is controlled by :ref:`neighbor_dist<class_NavigationAgent_property_neighbor_dist>`).
  203. Does not affect normal pathfinding. To change an actor's pathfinding radius bake :ref:`NavigationMesh<class_NavigationMesh>` resources with a different :ref:`NavigationMesh.agent_radius<class_NavigationMesh_property_agent_radius>` property and use different navigation maps for each actor size.
  204. .. rst-class:: classref-item-separator
  205. ----
  206. .. _class_NavigationAgent_property_target_desired_distance:
  207. .. rst-class:: classref-property
  208. :ref:`float<class_float>` **target_desired_distance** = ``1.0``
  209. .. rst-class:: classref-property-setget
  210. - void **set_target_desired_distance** **(** :ref:`float<class_float>` value **)**
  211. - :ref:`float<class_float>` **get_target_desired_distance** **(** **)**
  212. The distance threshold before the final target point is considered to be reached. This will allow an agent to not have to hit the point of the final target exactly, but only the area. If this value is set to low the NavigationAgent will be stuck in a repath loop cause it will constantly overshoot or undershoot the distance to the final target point on each physics frame update.
  213. .. rst-class:: classref-item-separator
  214. ----
  215. .. _class_NavigationAgent_property_target_location:
  216. .. rst-class:: classref-property
  217. :ref:`Vector3<class_Vector3>` **target_location** = ``Vector3( 0, 0, 0 )``
  218. .. rst-class:: classref-property-setget
  219. - void **set_target_location** **(** :ref:`Vector3<class_Vector3>` value **)**
  220. - :ref:`Vector3<class_Vector3>` **get_target_location** **(** **)**
  221. The user-defined target location. Setting this property will clear the current navigation path.
  222. .. rst-class:: classref-item-separator
  223. ----
  224. .. _class_NavigationAgent_property_time_horizon:
  225. .. rst-class:: classref-property
  226. :ref:`float<class_float>` **time_horizon** = ``5.0``
  227. .. rst-class:: classref-property-setget
  228. - void **set_time_horizon** **(** :ref:`float<class_float>` value **)**
  229. - :ref:`float<class_float>` **get_time_horizon** **(** **)**
  230. The minimal amount of time for which this agent's velocities, that are computed with the collision avoidance algorithm, are safe with respect to other agents. The larger the number, the sooner the agent will respond to other agents, but the less freedom in choosing its velocities. Must be positive.
  231. .. rst-class:: classref-section-separator
  232. ----
  233. .. rst-class:: classref-descriptions-group
  234. Method Descriptions
  235. -------------------
  236. .. _class_NavigationAgent_method_distance_to_target:
  237. .. rst-class:: classref-method
  238. :ref:`float<class_float>` **distance_to_target** **(** **)** |const|
  239. Returns the distance to the target location, using the agent's global position. The user must set :ref:`target_location<class_NavigationAgent_property_target_location>` in order for this to be accurate.
  240. .. rst-class:: classref-item-separator
  241. ----
  242. .. _class_NavigationAgent_method_get_final_location:
  243. .. rst-class:: classref-method
  244. :ref:`Vector3<class_Vector3>` **get_final_location** **(** **)**
  245. Returns the reachable final location in global coordinates. This can change if the navigation path is altered in any way. Because of this, it would be best to check this each frame.
  246. .. rst-class:: classref-item-separator
  247. ----
  248. .. _class_NavigationAgent_method_get_nav_path:
  249. .. rst-class:: classref-method
  250. :ref:`PoolVector3Array<class_PoolVector3Array>` **get_nav_path** **(** **)** |const|
  251. Returns this agent's current path from start to finish in global coordinates. The path only updates when the target location is changed or the agent requires a repath. The path array is not intended to be used in direct path movement as the agent has its own internal path logic that would get corrupted by changing the path array manually. Use the intended :ref:`get_next_location<class_NavigationAgent_method_get_next_location>` once every physics frame to receive the next path point for the agents movement as this function also updates the internal path logic.
  252. .. rst-class:: classref-item-separator
  253. ----
  254. .. _class_NavigationAgent_method_get_nav_path_index:
  255. .. rst-class:: classref-method
  256. :ref:`int<class_int>` **get_nav_path_index** **(** **)** |const|
  257. Returns which index the agent is currently on in the navigation path's :ref:`PoolVector3Array<class_PoolVector3Array>`.
  258. .. rst-class:: classref-item-separator
  259. ----
  260. .. _class_NavigationAgent_method_get_navigation:
  261. .. rst-class:: classref-method
  262. :ref:`Node<class_Node>` **get_navigation** **(** **)** |const|
  263. Returns the :ref:`Navigation<class_Navigation>` node that the agent is using for its navigation system.
  264. .. rst-class:: classref-item-separator
  265. ----
  266. .. _class_NavigationAgent_method_get_navigation_map:
  267. .. rst-class:: classref-method
  268. :ref:`RID<class_RID>` **get_navigation_map** **(** **)** |const|
  269. Returns the :ref:`RID<class_RID>` of the navigation map for this NavigationAgent node. This function returns always the map set on the NavigationAgent node and not the map of the abstract agent on the NavigationServer. If the agent map is changed directly with the NavigationServer API the NavigationAgent node will not be aware of the map change. Use :ref:`set_navigation_map<class_NavigationAgent_method_set_navigation_map>` to change the navigation map for the NavigationAgent and also update the agent on the NavigationServer.
  270. .. rst-class:: classref-item-separator
  271. ----
  272. .. _class_NavigationAgent_method_get_next_location:
  273. .. rst-class:: classref-method
  274. :ref:`Vector3<class_Vector3>` **get_next_location** **(** **)**
  275. Returns the next location in global coordinates that can be moved to, making sure that there are no static objects in the way. If the agent does not have a navigation path, it will return the position of the agent's parent. The use of this function once every physics frame is required to update the internal path logic of the NavigationAgent.
  276. .. rst-class:: classref-item-separator
  277. ----
  278. .. _class_NavigationAgent_method_get_rid:
  279. .. rst-class:: classref-method
  280. :ref:`RID<class_RID>` **get_rid** **(** **)** |const|
  281. Returns the :ref:`RID<class_RID>` of this agent on the :ref:`NavigationServer<class_NavigationServer>`.
  282. .. rst-class:: classref-item-separator
  283. ----
  284. .. _class_NavigationAgent_method_is_navigation_finished:
  285. .. rst-class:: classref-method
  286. :ref:`bool<class_bool>` **is_navigation_finished** **(** **)**
  287. Returns ``true`` if the navigation path's final location has been reached.
  288. .. rst-class:: classref-item-separator
  289. ----
  290. .. _class_NavigationAgent_method_is_target_reachable:
  291. .. rst-class:: classref-method
  292. :ref:`bool<class_bool>` **is_target_reachable** **(** **)**
  293. Returns ``true`` if :ref:`target_location<class_NavigationAgent_property_target_location>` is reachable.
  294. .. rst-class:: classref-item-separator
  295. ----
  296. .. _class_NavigationAgent_method_is_target_reached:
  297. .. rst-class:: classref-method
  298. :ref:`bool<class_bool>` **is_target_reached** **(** **)** |const|
  299. Returns ``true`` if :ref:`target_location<class_NavigationAgent_property_target_location>` is reached. It may not always be possible to reach the target location. It should always be possible to reach the final location though. See :ref:`get_final_location<class_NavigationAgent_method_get_final_location>`.
  300. .. rst-class:: classref-item-separator
  301. ----
  302. .. _class_NavigationAgent_method_set_navigation:
  303. .. rst-class:: classref-method
  304. void **set_navigation** **(** :ref:`Node<class_Node>` navigation **)**
  305. Sets the :ref:`Navigation<class_Navigation>` node used by the agent. Useful when you don't want to make the agent a child of a :ref:`Navigation<class_Navigation>` node.
  306. .. rst-class:: classref-item-separator
  307. ----
  308. .. _class_NavigationAgent_method_set_navigation_map:
  309. .. rst-class:: classref-method
  310. void **set_navigation_map** **(** :ref:`RID<class_RID>` navigation_map **)**
  311. Sets the :ref:`RID<class_RID>` of the navigation map this NavigationAgent node should use and also updates the ``agent`` on the NavigationServer.
  312. .. rst-class:: classref-item-separator
  313. ----
  314. .. _class_NavigationAgent_method_set_velocity:
  315. .. rst-class:: classref-method
  316. void **set_velocity** **(** :ref:`Vector3<class_Vector3>` velocity **)**
  317. Sends the passed in velocity to the collision avoidance algorithm. It will adjust the velocity to avoid collisions. Once the adjustment to the velocity is complete, it will emit the :ref:`velocity_computed<class_NavigationAgent_signal_velocity_computed>` signal.
  318. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  319. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  320. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  321. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`