Skip to content

Conversation

@dmlary
Copy link
Contributor

@dmlary dmlary commented Jul 4, 2025

stored_y_velocity was being reset when the navigation agent finished navigating. Also, it wasn't being stored when navigation was not ongoing. As a result, gravity could not be applied to navigation agents with avoidance enabled.

In this commit, I made two changes. Only reset stored_y_velocity in NavigationAgent3D::_transition_to_navigation_finished() if use_3d_avoidance is set. And save off the y velocity in NavigationAgent3D::set_velocity().

fixes #108252

`stored_y_velocity` was being reset when the navigation agent finished
navigating.  Also, it wasn't being stored when navigation was not
ongoing.  As a result, gravity could not be applied to navigation
agents with avoidance enabled.

In this commit, I made two changes.  Only reset `stored_y_velocity`
in `NavigationAgent3D::_transition_to_navigation_finished()` if
`use_3d_avoidance` is set.  And save off the y velocity in
`NavigationAgent3D::set_velocity()`.

fixes godotengine#108252
@dmlary dmlary requested a review from a team as a code owner July 4, 2025 14:17
@AThousandShips AThousandShips added bug topic:navigation topic:3d cherrypick:4.4 Considered for cherry-picking into a future 4.4.x release labels Jul 4, 2025
@AThousandShips AThousandShips added this to the 4.5 milestone Jul 4, 2025
@Repiteo Repiteo added the cherrypick:4.5 Considered for cherry-picking into a future 4.5.x release label Sep 5, 2025
@Repiteo Repiteo modified the milestones: 4.5, 4.6 Sep 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug cherrypick:4.4 Considered for cherry-picking into a future 4.4.x release cherrypick:4.5 Considered for cherry-picking into a future 4.5.x release topic:navigation topic:3d

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NavigationAgent3D avoidance disregards Keep Y Velocity when navigation has finished; breaks gravity

3 participants