When I use
NavigationServer2D.bake_from_source_geometry_data()
, the mesh is created and it looks fine in debug, but the agent can’t find it for some reason.
nav_region.bake_navigation_polygon()
works, but I need to use the other bake function to create “holes” in the mesh.
i suggest to follow the documentation i sent, the replied i showed is for someone’s issue. he uses the same Nav Region and Tries to use Navigation Server to bake new meshed, but discombobulated on why it needs to reassign the navigation region’s mesh to itself again
the take away is, if you want to use the code, try downloading the project he sent and replace that script code to the one i replied.
Note: if you asked why it needs reassign to itself after post baking it, read the post’s replies, it should be clear why. tl;dr it’s the way it’s to load the mesh back to nav region. the NavigationServer2D.bake_from_source_geometry_data() is never meant to be used with your own pre created NavigationRegion Node anyway. but people tried. Documentation showed the right way to use it. That reply showed how to set the created mesh to pre-created NavigationRegion polygon
the bake broken is the one that uses NavigationServer2D.bake_from_source_geometry_data(), but i fixed so it’s usable now on that reply.