From ec3ed48fbe149baf639cf213d153d0daceff3aae Mon Sep 17 00:00:00 2001 From: skyace65 Date: Fri, 2 Feb 2024 20:22:19 -0500 Subject: [PATCH] Replace set_velocity with velocity property --- .../navigation/navigation_using_navigationagents.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tutorials/navigation/navigation_using_navigationagents.rst b/tutorials/navigation/navigation_using_navigationagents.rst index 760c9724a11d..16f3854137cf 100644 --- a/tutorials/navigation/navigation_using_navigationagents.rst +++ b/tutorials/navigation/navigation_using_navigationagents.rst @@ -98,7 +98,7 @@ The ``velocity_computed`` signal of the NavigationAgent node must be connected t .. image:: img/agent_safevelocity_signal.png -Use ``set_velocity()`` on the NavigationAgent node in ``_physics_process()`` to update the agent with the current velocity of the agent's parent node. +Set the ``velocity`` of the NavigationAgent node in ``_physics_process()`` to update the agent with the current velocity of the agent's parent node. While avoidance is enabled on the agent the ``safe_velocity`` vector will be received with the velocity_computed signal every physics frame. 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 ` wit var next_path_position: Vector3 = navigation_agent.get_next_path_position() var new_velocity: Vector3 = global_position.direction_to(next_path_position) * movement_delta if navigation_agent.avoidance_enabled: - navigation_agent.set_velocity(new_velocity) + navigation_agent.velocity = new_velocity else: _on_velocity_computed(new_velocity) @@ -237,7 +237,7 @@ This script adds basic navigation movement to a :ref:`CharacterBody3D