Skip to content

NavigationAgent3D: finish closer to the final waypoint when target_desired_distance < path_desired_distance #108265

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dmlary
Copy link
Contributor

@dmlary dmlary commented Jul 4, 2025

When NavigationAgent3D.target_desired_distance is less than NavigatinAgent3D.path_desired_distance, use the smaller value in NavigationAgent3D::_is_within_waypoint_distance() when matching the last waypoint. This allows the agent to get closer to the final position while still allowing flexibility when matching waypoints.

Prior to this change, the navigation would finish outside the target_desired_distance when it was less than path_desired_distance.

fixes #108261

When NavigationAgent3D.target_desired_distance is less than
NavigatinAgent3D.path_desired_distance, use the smaller value in
NavigationAgent3D::_is_within_waypoint_distance() when matching the last
waypoint.  This allows the agent to get closer to the final position
while still allowing flexibility when matching waypoints.

Prior to this change, the navigation would finish outside the
target_desired_distance when it was less than path_desired_distance.

fixes godotengine#108261
@dmlary dmlary requested a review from a team as a code owner July 4, 2025 04:30
@Chaosus Chaosus added this to the 4.6 milestone Jul 4, 2025
@Calinou Calinou added bug and removed enhancement labels Jul 4, 2025
@Calinou Calinou modified the milestones: 4.6, 4.5 Jul 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NavigationAgent3D finishes prematurely on dense NavigationMeshes when target_desired_distance < path_desired_distance
3 participants