fix: emit target_reached signal after updating state

This commit is contained in:
Sam Briels 2022-10-31 08:14:32 +01:00
parent 80b50e59d5
commit 3e186ae043

View file

@ -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");
}
}
}