From 799a6e334f06d6fe1f3328e7ab4ac667bdba7c26 Mon Sep 17 00:00:00 2001 From: Sam Briels Date: Mon, 31 Oct 2022 08:14:32 +0100 Subject: [PATCH] fix: emit target_reached signal after updating state --- scene/2d/navigation_agent_2d.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scene/2d/navigation_agent_2d.cpp b/scene/2d/navigation_agent_2d.cpp index c88b9b1bd..43975a4a6 100644 --- a/scene/2d/navigation_agent_2d.cpp +++ b/scene/2d/navigation_agent_2d.cpp @@ -492,8 +492,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"); } } }