From 37530b087104f1c7f2d35a579f838a5de8c5b45b Mon Sep 17 00:00:00 2001 From: smix8 <52464204+smix8@users.noreply.github.com> Date: Wed, 18 May 2022 13:53:46 +0200 Subject: [PATCH] Update NavigationPolygonInstance when polygons of NavigationPolygon change Updates NavigationPolygonInstance polygons on the NavigationServer2D when the NavigationPolygon Resource emits its changed signal due to e.g. polygons altered by script. --- scene/2d/navigation_polygon.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scene/2d/navigation_polygon.cpp b/scene/2d/navigation_polygon.cpp index 4afd527e8c4..ae505851e54 100644 --- a/scene/2d/navigation_polygon.cpp +++ b/scene/2d/navigation_polygon.cpp @@ -498,6 +498,9 @@ void NavigationPolygonInstance::_navpoly_changed() { if (is_inside_tree() && (Engine::get_singleton()->is_editor_hint() || get_tree()->is_debugging_navigation_hint())) { update(); } + if (navpoly.is_valid()) { + Navigation2DServer::get_singleton()->region_set_navpoly(region, navpoly); + } } String NavigationPolygonInstance::get_configuration_warning() const {