You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tutorials/navigation/navigation_using_navigationagents.rst
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -98,7 +98,7 @@ The ``velocity_computed`` signal of the NavigationAgent node must be connected t
98
98
99
99
.. image:: img/agent_safevelocity_signal.png
100
100
101
-
Use ``set_velocity()`` on the NavigationAgent node in ``_physics_process()`` to update the agent with the current velocity of the agent's parent node.
101
+
Set the ``velocity`` of the NavigationAgent node in ``_physics_process()`` to update the agent with the current velocity of the agent's parent node.
102
102
103
103
While avoidance is enabled on the agent the ``safe_velocity`` vector will be received with the velocity_computed signal every physics frame.
104
104
This velocity vector should be used to move the NavigationAgent's parent node in order to avoidance collision with other avoidance using agents or avoidance obstacles.
@@ -204,7 +204,7 @@ This script adds basic navigation movement to a :ref:`Node3D <class_Node3D>` wit
204
204
var next_path_position: Vector3 = navigation_agent.get_next_path_position()
205
205
var new_velocity: Vector3 = global_position.direction_to(next_path_position) * movement_delta
206
206
if navigation_agent.avoidance_enabled:
207
-
navigation_agent.set_velocity(new_velocity)
207
+
navigation_agent.velocity = new_velocity
208
208
else:
209
209
_on_velocity_computed(new_velocity)
210
210
@@ -237,7 +237,7 @@ This script adds basic navigation movement to a :ref:`CharacterBody3D <class_Cha
237
237
var next_path_position: Vector3 = navigation_agent.get_next_path_position()
238
238
var new_velocity: Vector3 = global_position.direction_to(next_path_position) * movement_speed
239
239
if navigation_agent.avoidance_enabled:
240
-
navigation_agent.set_velocity(new_velocity)
240
+
navigation_agent.velocity = new_velocity
241
241
else:
242
242
_on_velocity_computed(new_velocity)
243
243
@@ -271,7 +271,7 @@ This script adds basic navigation movement to a :ref:`RigidBody3D <class_RigidBo
271
271
var next_path_position: Vector3 = navigation_agent.get_next_path_position()
272
272
var new_velocity: Vector3 = global_position.direction_to(next_path_position) * movement_speed
0 commit comments