Skip to content

Only repath a NavigationAgent with a target position #107513

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

Merged
merged 1 commit into from
Jun 14, 2025

Conversation

smix8
Copy link
Contributor

@smix8 smix8 commented Jun 13, 2025

Only repaths a NavigationAgent with a target position.

Resolves #101232

It is correct that a repath should happen when the navigation_layers or navigation map changes as the old path can become invalid with such a change.

However a repath only makes sense while an agent is intended to follow a path already, aka has a target_position set.

There shouldn't be a path update without a target_position. The agent can do nothing with such a path. As can be seen by the linked issue all it does is set the wrong internal pathfollowing state.

Only repaths a NavigationAgent with a target position.
@smix8 smix8 added the bug label Jun 13, 2025
@smix8 smix8 requested a review from a team as a code owner June 13, 2025 23:33
@smix8 smix8 requested a review from a team as a code owner June 13, 2025 23:33
@AThousandShips AThousandShips added this to the 4.5 milestone Jun 14, 2025
@akien-mga akien-mga merged commit f99629a into godotengine:master Jun 14, 2025
20 checks passed
@akien-mga
Copy link
Member

Thanks!

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.

On scene load, NavigationAgent2D has target 0,0 and is_navigation_finished() == false when there is more than one navigation layer set
3 participants