Emit target_reached signal after state is updated
This commit is contained in:
parent
03e5de37ae
commit
815231943b
2 changed files with 2 additions and 2 deletions
|
@ -478,8 +478,8 @@ void NavigationAgent2D::_request_repath() {
|
|||
void NavigationAgent2D::_check_distance_to_target() {
|
||||
if (!target_reached) {
|
||||
if (distance_to_target() < target_desired_distance) {
|
||||
emit_signal(SNAME("target_reached"));
|
||||
target_reached = true;
|
||||
emit_signal(SNAME("target_reached"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -495,8 +495,8 @@ void NavigationAgent3D::_request_repath() {
|
|||
void NavigationAgent3D::_check_distance_to_target() {
|
||||
if (!target_reached) {
|
||||
if (distance_to_target() < target_desired_distance) {
|
||||
emit_signal(SNAME("target_reached"));
|
||||
target_reached = true;
|
||||
emit_signal(SNAME("target_reached"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue