Recast is registering areas within colliders as walkable

Hi,

I’m using recast to generate the pathing mesh for a terrain with objects on it. I want the pathing mesh to only exist outside/around these placed objects. I’ve marked the objects (pyramids in this case) to block the pathing mesh with a recast mesh obj script, and they are making the generated grid go around the objects… But the navmesh is also ghenerating small orphaned areas within the objects at the ground level, its as if the casting is respecting the walls of the cubes as unwalkable, but is casting through the roof of the pyramids to make an islanded area inside. Obviously this is unneeded and will really overcomplicated the resulting graph… Ideally i want only 1 single pathable mesh area. See the image below. Any advice would be most appreciated. Thanks!

Hi

The voxelization process only considers the faces of meshes, this is why it considers it ok to have regions inside obstacles.

There are a number of ways to solve this.

  1. Increase the “Min Region Size” parameter on the recast graph.
    It is measured in voxels so you might need very large values (tens or hundreds of thousands sometimes).
    This will not work if the region is on the border of a tile however as it is impossible to determine the exact size of the region during the calculation of an individual tile.

  2. Use the RelevantGraphSurface component. See http://arongranberg.com/astar/docs/class_pathfinding_1_1_recast_graph.php#a6915c7a3bc45a0a4201e8d4919eda9f1

  3. Use a navmesh cut over the regions you want to have removed, a bit annoying so the other options are probably to be preferred.

  4. Increase the Character Height setting on the recast graph. If it is high enough, the graph will figure out that it would be impossible for a character to stand inside that obstacle, and will thus flag it all as unwalkable.
    This is probably the easiest solution as you seem to have an open terrain.

Hi Aron, thanks!

option 4 seems like the best solution, since I don’t have any overhangs or tunnels
Unfortunately i can only see character radius, which id assume does x,y,z
Am I missing something?

ah, looking at the src doc, walkable height appears to be character height (as opposed to walkable climb which is max difference valid for a slope/step i assume), and setting that is giving me much better results… thanks

Yeah, sorry about the typo.