Navigation API has been reworked for Godot 4.1, but the docs aren't synced yet.
The docs make it seem like NavigationAgent3D.velocity_computed
signal is emitted only after NavigationAgent3D.velocity
is set to a new value, but this is incorrect see doc ref..
velocity_computed
signal is emitted every frame because the navigation agent has no concept of "standing still" as explained in this issue comment.
Furthermore, the callback registered with velocity_computed
will be called with the last computed safe_velocity
. In practice this means that it isn't enough to set_physics_process(false)
.
One workaround is to connect the velocity_computed
signal when we set a new target and disconnect it when the target is reached. I don't know if there are any corner cases here.
Checking the docs from latest, they differ from stable regarding navigation obstacles.