From 5769b0e8d8db75ff500c979aa63d3f3428de526d Mon Sep 17 00:00:00 2001 From: Josh Jones Date: Fri, 30 Sep 2022 23:49:39 -0600 Subject: Enable assigning an owner to navigation regions and links This allows users of the server APIs to get back the nodes that created certain regions and links. --- scene/2d/navigation_region_2d.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'scene/2d/navigation_region_2d.cpp') diff --git a/scene/2d/navigation_region_2d.cpp b/scene/2d/navigation_region_2d.cpp index 13d371042b..7bf3eec79b 100644 --- a/scene/2d/navigation_region_2d.cpp +++ b/scene/2d/navigation_region_2d.cpp @@ -634,7 +634,9 @@ void NavigationRegion2D::_bind_methods() { NavigationRegion2D::NavigationRegion2D() { set_notify_transform(true); + region = NavigationServer2D::get_singleton()->region_create(); + NavigationServer2D::get_singleton()->region_set_owner_id(region, get_instance_id()); NavigationServer2D::get_singleton()->region_set_enter_cost(region, get_enter_cost()); NavigationServer2D::get_singleton()->region_set_travel_cost(region, get_travel_cost()); -- cgit v1.2.3