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
The "Target Reached" signal on the NavigationAgent2D node does not reliably trigger when the path desired distance is set above the target desired distance
#85247
When using the NavigationAgent2D the "target reached" signal usually does not trigger if the target desired distance value is below the path desired distance. If, however, the navigation agent target position is set while the agent is within the desired distance then it will reliably trigger.
This can be simulated by either issuing a nearby move command or by setting (and thus recalculating) the target position every frame.
Steps to reproduce
Implement a basic CharacterBody2D
Add a NavigationAgent2D node and leave the default values
Set up the CharacterBody2D to move when its NavigationAgent2D has its movement position set (based on the Using NavigationAgents documentation)
Connect the on_target_reached and on_navigation_finished signals
Move the character around and observe that navigation is finished before the target is reached when the target position is set beyond the target desired distance
Move the character a small distance within the target desired distance; observe the target reached signal reliably triggers
Set the target desired distance higher than the path desired distance (or vice versa); observe that the target reached signal more reliably triggers.
Godot version
4.2-rc1
System information
Windows 11, Vulkan
Issue description
When using the NavigationAgent2D the "target reached" signal usually does not trigger if the target desired distance value is below the path desired distance. If, however, the navigation agent target position is set while the agent is within the desired distance then it will reliably trigger.
This can be simulated by either issuing a nearby move command or by setting (and thus recalculating) the target position every frame.
Steps to reproduce
Minimal reproduction project
target-reached-test.zip
The text was updated successfully, but these errors were encountered: