I have a big flat floor / terrain. I slap a big rock on it and tell the NavMesh system to generate a navmesh. It all looks fine in editor… except its not.
If I fly the camera inside the big rock, there appears to be an isolated island of blue navmesh, where the Nav system things its ok to walk to.
But its impossible to get there… it should be excluded from the navmesh.
part 2…
If I randomly select a target (that happens to be on that isolated blue splotch inside the rock) and then tell the Nav Avent to go there…
bool targetOK = navAgent.SetDestination(newPos)
It responds that targetOK = true… when it should be false…
Is there any way to generate Nav Meshes, that don’t put valid areas inside of enclosed geometry ?
found a way… in navmesh bake settings… advanced->min region area… set this to a large number, large enough to exclude any solitary non-connected meshes in the scene.
This only works for our style scenes/maps, will not work for all cases.
This is expected behaviour, and it doesn’t matter because if it’s not connected an agent wouldn’t walk there anyway. However if you placed an agent inside the rock it’s only logical that it’d walk there.
thats actually the second part of the problem… It doesn;t behave as expected.
I don’t place an agent in there… The agent starts outside in a valid area. but if I randomly select a “valid” point on the navmesh (inside that island) and tell it to go there… it does not tell me its not a valid point, or that it cannot get there… it goes ahead and starts moving there, tries to get there, and gets stuck as it actually cant get there. (it just walked into the face of the rock wall, and stops. heh
anyways, problem currently solved with the min-region parameter.