diff options
author | smix8 <52464204+smix8@users.noreply.github.com> | 2022-05-18 13:36:18 +0200 |
---|---|---|
committer | smix8 <52464204+smix8@users.noreply.github.com> | 2022-05-18 13:36:18 +0200 |
commit | 4035a4103cebb2a90696123f0bd510ac9b2f2c09 (patch) | |
tree | 2bd4d1bc6b3aacd82ce799117a8ea5d1f57ea920 /scene/2d/navigation_region_2d.cpp | |
parent | 7ea8cde9834b0fda4a928217b7880da3dd330214 (diff) | |
download | redot-engine-4035a4103cebb2a90696123f0bd510ac9b2f2c09.tar.gz |
Update NavigationRegion2D when polygons of NavigationPolygon change
Updates NavigationRegion2D when the NavigationPolygon emits its 'changed' signal due to e.g. polygons altered by script.
Diffstat (limited to 'scene/2d/navigation_region_2d.cpp')
-rw-r--r-- | scene/2d/navigation_region_2d.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/scene/2d/navigation_region_2d.cpp b/scene/2d/navigation_region_2d.cpp index f46453283c..260faf1d68 100644 --- a/scene/2d/navigation_region_2d.cpp +++ b/scene/2d/navigation_region_2d.cpp @@ -509,6 +509,9 @@ void NavigationRegion2D::_navpoly_changed() { if (is_inside_tree() && (Engine::get_singleton()->is_editor_hint() || get_tree()->is_debugging_navigation_hint())) { update(); } + if (navpoly.is_valid()) { + NavigationServer2D::get_singleton()->region_set_navpoly(region, navpoly); + } } void NavigationRegion2D::_map_changed(RID p_map) { if (enabled && get_world_2d()->get_navigation_map() == p_map) { |