Meshes and/or Colliders Not Detected as Unwalkable by Recast Graph

I am using a Recast graph with the settings below:

I have set 4 layers in the Layer Mask: Ground, Player, Opponent, and Obstacles.

Additionally, I have attached to each GameObject (Unity cube) in the Obstacles layer the RecastMeshObj with the settings below:

After Scanning, the “Ground” layer is detected well, but some GameObjects in the “Opponent” layer are not detected. This results in some Opponents getting marked as unwalkable, but some others with the same configuration (except their meshes) not getting marked as unwalkable. Similarly, the cube GameObjects, which are all in the “Obstacles” layer don’t get marked as unwalkable, even after I attach the RecastMeshObj to them as I mentioned above. This can be seen in the following screenshot:

In this screenshot showing a part of the Raycast graph, the graph fits very well over the racetrack, which is in the “Ground” layer (the brownish area below the racetrack is in the “Default” layer). On the top left of the image, we can see one of the cars inside an unwalkable area, and on the bottom right another car is within the main walkable area, while both cars are in the “Opponent” layer. Three white cubes are also visible within the main walkable area, even though they have the settings I mentioned above.

I tried changing many settings of the Recast graph but there was no change in what was detected as unwalkable. e.g. The screenshot below is when I set the cell size to 0.23 (from the default 0.5).

I have also tried using a Grid graph. In this case, all cars and obstacles were correctly detected as unwalkable, but I faced some other problems with the Grid graph, so I started trying other graphs.

EDIT: I forgot to mention that all cars also have the DynamicGridObstacle component on them.

I’d appreciate your feedback on this.

Thank you in advance!


Try reducing the walkable climb field. It might decide that the obstacles are small enough to be discarded.

1 Like

Thank you for your response!

Yes, that solved the problem with the Obstacles, all cubes showed up after I set the walkable climb to 0 (the cars will not climb at all). However, some of the cars still didn’t get detected correctly so I kept looking for a solution for them.

After re-reading the manual, especially Automatically generating a navmesh I realized that I had messed up the graph’s bounds!

The first time I clicked the “Snap Bounds To Scene” button, I got the impression that the bounds height was too large, as it extended much lower than the racetrack, and much higher above it, which appeared to me to be empty space. So, I reduced the height to cover only the thickness of the racetrack.

So, this time round I clicked the “Snap Bounds To Scene” button again, scanned again, and all cars and obstacles were properly detected.

I think I just didn’t understand correctly the purpose of the bounds created by the “Snap Bounds To Scene” button during my first read. I’m still learning.

Thank you for this great software, and your support!!!

1 Like