Unwanted border in RecastGraph scanning

  • A* version: 5.1.1
  • Unity version: 2022.3.30f1

A summary of what I’m trying to do:
I’m generating a dungeon which is made out of rooms placed beside each other procedurally. Each room will be pre-scanned before the game runs, and the output be assigned to a NavmeshPrefab component on said room. Each room will have one or more floor colliders used in scanning. Tiling is enabled, and the rooms are positioned according to the tiling grid to make sure they snap together into a continuous navmesh during runtime.

I ran into a complication immediately, which is that while the buffer brought about by Character Radius is welcomed for props that are supposed to hinder pathfinding entities, it is unwanted in the case of boundaries for my case (since I want the room navmeshes to snap together into one continuous navmesh).

So, I changed the Character Radius to 0. However, there is still a border at the top and right side of the scanned navmesh

Then, I tried extending the floor collider beyond the boundaries (just for the scanning process) to see if I could get rid of the gap somehow. It doesn’t fully work.

image

Is this some weird rounding error I’m getting? Is there a reliable way which I can get rid of the gap somehow?

Hi

Take a look at the “Accounting for borders” section in the NavmeshPrefab docs: NavmeshPrefab - A* Pathfinding Project

Make sure that your bounding box is a multiple of your voxel size.

I would also recommend upgrading to a newer version of the A* package. I believe several bugfixes for the navmesh prefab have been made since 5.1.1.

Hi, I’m able to get a baseline sample working after updating. And it still works after reverting back to the version I was at. So there’s probably some setup detail in my project that’s causing this weird behavior. Thanks!