RecastMeshObj doesn't block out an area, only the outline of the mesh/collider

Hi!

I recently been using the pro version of A* Pathfinding for my project, but have encountered an issue, I’m not sure if it’s something I’m doing wrong, or a bug.

Above you can see that I have a simple cube on the terrain. I’ve attached a RecastMeshObj and set the Area Type to Unwalkable Surface. I’ve tried both Dynamic on and off (I would use off in my case, since it’s static).

I was expecting the entire volume to be excluded, and not a part in the center to be included.

In a real use scenario I was attaching the RecastMeshObj script to a house to block out, but it was doing the same behaviour where the insides were all walkable.

I’ve reproduced it in the Example2_Terrain example as follows:

  1. Remove the Grid Graph and add a Recast Graph.
  2. Click the Snap bounds to scene button
  3. Add a cube with RecastMeshObj and embed it slightly in the terrain
    image
  4. Scan

Hi

This is expected in the current released version. However you can use the beta version in which colliders are treated as solid by default.
See A* Pathfinding Project

Perfect! Once I clicked the ‘Solid’ checkbox it worked as I expected, thank you!

It also looks like the recast process has improved, because I now need to do a lot less cleanup work as most other objects without the RecastMeshObj are also being treated as solid!

Great!

Yes, all colliders are treated as solid by default.

As a related request because I’ve been using the RecastMeshObj from the beta:

Could you change the ‘Auto’ use of Mesh and Colliders to allow us to specify either one over the other, or to force one?

My use case is:

I have a mesh and a collider on a single game object. I don’t want to deepen the object tree by adding sub objects to all my meshes, just so this component can be added to the sub object with just a collider, so I’d prefer to tell the component to only look for a Collider.

I.e. I could see a drop down that allows me to choose ‘Collider’ or ‘Mesh’. Potentially the drop down has an ‘Auto’ option. Or the drop down just allows me to choose the precendence (I.e. Collider first, then Mesh, or Mesh first then collider).

Basically just a way for me to make the choice of Collider or Mesh first, instead of the code forcing Mesh.

(Perhaps the ‘Rasterize’ option from the Recast Graph should be followed here? I.e. I use ‘Rasterize Colliders’ for my Recast Graph, but when it processes the RecastMeshObj, it’s picking Meshes first)

Thanks for the suggestion. I’ll conside it. It seems like a reasonable thing to have a dropdown.