Skip to content

Commit

Permalink
fix: emit target_reached signal after updating state
Browse files Browse the repository at this point in the history
  • Loading branch information
sambriels committed Oct 31, 2022
1 parent 80b50e5 commit 3e186ae
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scene/2d/navigation_agent_2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -481,8 +481,8 @@ void NavigationAgent2D::_request_repath() {
void NavigationAgent2D::_check_distance_to_target() {
if (!target_reached) {
if (distance_to_target() < target_desired_distance) {
emit_signal("target_reached");
target_reached = true;
emit_signal("target_reached");
}
}
}

0 comments on commit 3e186ae

Please sign in to comment.