From 1d428ac1c9aec6de943e35dd4c4f95bf40d67126 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 e9ec1a3e7..cb4a2ccec 100644 --- a/scene/2d/navigation_polygon.cpp +++ b/scene/2d/navigation_polygon.cpp @@ -499,6 +499,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 {