Most likely cause is that the geometry (the MeshInstance
in this case) is too small.
First look at the property cell/size
(the property Size under Cell). Which is the step for the coordinates of the navigation mesh. The default value is 0.3.
Then look at the property region/min_size
(the property Min Size under Region). Which is the square root of how many cells a region must have.
So if you added a MeshIntance
with a CubeMesh
of the default dimensions, it is 2 by 2 by 2. So it has an up face of 2 by 2. In there we can fit 6 by 6 cells of 0.3. For a total of 36 cells. Ah, but the minimum region size is 8, that means that it needs at least 64 cells. So Godot will NOT create that region.
You can either:
- Make the
MeshIntance
bigger.
- Make the
cell/size
smaller.
- Make the
region/min_size
smaller.
Another thing is whether or not the region would be big enough for the "Agent". You can see in the NavigationMesh
resource, under "Agent" the properties:
agent/height
(the default value is 2)
agent/radius
(the default value is 0.6)
agent/max_climb
(the default value is 0.9)
agent/max_slope
(the default value is 45)
This is what Godot will use to decide what areas are navigable. You will want to set these to match whatever will be moving using the navigation mesh.
Addendum: If I'm not mistaken, what actually happens is that the area is considered smaller by the radius. So the 2 by 2 face is reduced to 0.8 by 0.8 and then the rules I said above apply. I'm not entirely sure because I calculate that the minimum square area with the default settings that generates region should be 3.6 by 3.6, but in testing I find 3.5 by 3.5. Perhaps due to something about rounding to cells is my best guess.
By the way, also check geometry/parsed_geometry_type
is what you want. By default it is set to use MeshIntance
, but you may want to use physics objects instead.