Difficulty Visualizing Navigation Regions Created with Code #9641
Replies: 1 comment
-
The navigation debug visuals are currently all part of the navigation related nodes so there are no debug visuals for anything that just exists inside the NavigationServer without a Node in the SceneTree. There are plans to change this, see proposal #7208. If you want to draw your own debug for a NavigationPolygon resource it is a matter of drawing polygons for each polygon.
That the NavigationServer even allows to set a resource directly on the API is legacy mold and bound to be removed. See proposal #6317. A server runs with RID handles, allowing users to set a resource directly creates a ton of issues on top of needing multiple data copies for nothing. If you update something with a server API only it is assumed that you have a handle to whatever you are updating and a handle to whatever data you are using for the upate. The NavigationPolygon is basically your handle for the data, don't throw away your handles. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I've been trying to get a handle on creating navigation regions using code rather than using the NavigationRegion2D node. I was planning on making a small test scene and using the navigation debugger to see the regions and make sure they were how I expected them to be, but after a few days of trying without being able to get anything to appear I've realized that the debugger only shows regions made using the node. I know the region exists because my test agent can use it to navigate, but it doesn't get drawn.
My next plan was to get the polygons from the regions using NavigationServer2D and draw them from that, but as far as I can tell there's no way to get the polygon of the region; there is a setter function (NavigationServer2D.region_set_navigation_polygon(...)), but no getter.
Unless I'm missing something, I'd like to suggest that either or both of these gets changed; I'm assuming the code-based regions not being drawn is an oversight, and I'm not sure why a user shouldn't be able to get the polygons of the regions. My next plan for debugging is to just keep a copy of all the navigation polygons to draw, but I'd rather not have to do that.
Beta Was this translation helpful? Give feedback.
All reactions