Skip to content

Commit ec3ed48

Browse files
committed
Replace set_velocity with velocity property
1 parent c42e54b commit ec3ed48

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tutorials/navigation/navigation_using_navigationagents.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ The ``velocity_computed`` signal of the NavigationAgent node must be connected t
9898

9999
.. image:: img/agent_safevelocity_signal.png
100100

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.
102102

103103
While avoidance is enabled on the agent the ``safe_velocity`` vector will be received with the velocity_computed signal every physics frame.
104104
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
204204
var next_path_position: Vector3 = navigation_agent.get_next_path_position()
205205
var new_velocity: Vector3 = global_position.direction_to(next_path_position) * movement_delta
206206
if navigation_agent.avoidance_enabled:
207-
navigation_agent.set_velocity(new_velocity)
207+
navigation_agent.velocity = new_velocity
208208
else:
209209
_on_velocity_computed(new_velocity)
210210

@@ -237,7 +237,7 @@ This script adds basic navigation movement to a :ref:`CharacterBody3D <class_Cha
237237
var next_path_position: Vector3 = navigation_agent.get_next_path_position()
238238
var new_velocity: Vector3 = global_position.direction_to(next_path_position) * movement_speed
239239
if navigation_agent.avoidance_enabled:
240-
navigation_agent.set_velocity(new_velocity)
240+
navigation_agent.velocity = new_velocity
241241
else:
242242
_on_velocity_computed(new_velocity)
243243

@@ -271,7 +271,7 @@ This script adds basic navigation movement to a :ref:`RigidBody3D <class_RigidBo
271271
var next_path_position: Vector3 = navigation_agent.get_next_path_position()
272272
var new_velocity: Vector3 = global_position.direction_to(next_path_position) * movement_speed
273273
if navigation_agent.avoidance_enabled:
274-
navigation_agent.set_velocity(new_velocity)
274+
navigation_agent.velocity = new_velocity
275275
else:
276276
_on_velocity_computed(new_velocity)
277277

0 commit comments

Comments
 (0)