How create a navmesh from subscenes procedural generation ?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Sebajuste

Hi all,

I have some issues to create a navigation mesh for a procedural dungeon.
I’m using scenes as tiles. I don’t use a Grid, because it support only one mesh.
I could use a 3D software like Blender to create a tile, but I never used Blender, and it’s more effisciently to edit the scene in the game engine to make updates for my tiles (and create some variations of them)

So at this point I can create a procedural dungon, but without a navmesh.

The NavigationMeshInstance have a button to bake a navmesh from a scene. It’s perfect if I create my dungeon manualy in the editor. But this function seems not present in GDScript to call it at runtime.

I had the idea to create a NavigationMeshInstance for each subscene, and merge them at the end of the procedural generation. But the vertices of each navmesh are not the same. So A* algorithm can found a path only inside a subscene. Not for the entire dungeon.

Finally, I searched in the source code of Godot the algorithm for the Bake function is the editor to find a solution ( maybe create a module to export this function in GDScript ?) but I did not find it ?

Anyone have suggestion about this ?

:bust_in_silhouette: Reply From: FrankischZocker

Hi, create a Navigation Node in your MainScene than you can add to your Script navmesh_add( NavigationMesh mesh, Transform xform, Object owner=null ).

So you can add the NavMesh from your SubScene to the Navigation.
In my Case i Build a SpaceShip in Game (Empyrion like).
If i use Cubes only, thats no Problem. But i use Elements (3m, 1m, 3m) which i can rotate on all Axis.
Any Idae for my Case?