Closed wkirby closed 1 year ago
For added context, I may be misunderstanding the expected interactions between the 3D navigation system and grid maps. My desired functionality is to make some meshes in my gridmap navigable, and some non-navigable. My understanding from the existing documentation is that if I add a nav mesh to some mesh instances, and tick the bake_navigation
setting in the Grid Map, that the Grid Map will produce a navigation region from the nav meshes.
Relevant documentation from GridMap
:
If true, this GridMap creates a navigation region for each cell that uses a mesh_library item with a navigation mesh. The created navigation region will use the navigation layers bitmask assigned to the MeshLibrary's item.
Still happening on v4.0.beta17.mono.official [c40020513]
The reason why this does not work for you is cause you don't use a valid NavigationMesh
.
If you enable navigation debug in Editor->Debug->Visible Navigation
you will see quickly what is wrong. Seems like you just copied over your visual mesh to the navigation mesh slot. This does not work as a navigation mesh can not have a volume, it needs to have flat surfaces.
The GridMap does no baking, it reads the already baked navigation meshes from the MeshLibrary and the MeshLibrary expects already baked NavigationMesh resources when you set cell items. The bake_navigation
option on the GridMap creates navigation regions for each cell with a MeshLibrary navigation mesh but it does not baking of the navigation meshes from any source geometry. That step needs to happen already before and when you create your MeshLibrary.
What you can do is use a NavigatioRegion3D
, add a NavigationMesh
resource and set the agent_radius
to zero, add a child MeshInstance3D
and add you visual mesh inside. Then bake your NavigationMesh, store it on disk and load it in your MeshLibrary as the cell navigation mesh.
Godot version
v4.0.beta16.mono.official [518b9e580]
System information
macOS Ventura 13.1, M1 Max
Issue description
Attempting to integrate Navigation Mesh and Grid map results in the following error:
This results in nav agents being unable to navigate the resulting nav region.
Steps to reproduce
Creating the Mesh Library
Using the Mesh Library
bake_navigation
is set totrue
Minimal reproduction project
Navigation Test.zip