MilosLukic / Godot-Navigation-Lite

Godot plug&play implementation of detour. It allows user to have multiple navigation meshes, fast cached obstacles, and realtime navmesh changes.
Other
132 stars 12 forks source link

Issue Baking navmesh Procedural Generation #13

Open NovaCodee opened 3 years ago

NovaCodee commented 3 years ago

I am attempting to make a procedural generation script. The scripts works fine with normal navmesh, however, the pathing is bad so I decided to try this. When trying to use this I attempted to bake the navmesh and the program just closes every time. Here is the code I used

var mesh = MeshInstance.new()
var staticBody = StaticBody.new()

mesh.mesh = surface_tool.commit()
staticBody.add_child(mesh)
staticBody.add_child(mesh.create_trimesh_collision())
get_node('/root/Spatial/Navigation').add_child(staticBody)
get_node('/root/Spatial/Navigation/DetourNavigationMesh').bake_navmesh()

The plane is only 50 x 50 since 800 x 800 took ages to load. Thanks for the help.

MilosLukic commented 3 years ago

Check out this implementation of detour: https://github.com/TheSHEEEP/godotdetour I think that it has a strong focus on procedural generation. I am no longer maintaining this library due to Godot 4.0 coming out soon and it "might" have its own navigation implementation.