Large grids disrupt obstacle detection?

I just picked up this asset a few hours ago and I’ve been playing around with a very simple 2D test scene in Unity 5.6.4 involving one AI and 7 obstacles.

I was extremely confused as to why no nodes were detected as obstacles / not traversable until I changed my grid size from 50x50 nodes to 25x25 nodes. As soon as I did this and rescanned the graph, my 7 obstacle nodes were immediately detected.

If I go back to 50x50 and rescan, even though the pathfinding grid clearly overlaps them correctly, they are not detected. I have tried repositioning the 50x50 grid many times and it makes no difference; none of the obstacles (simple Box Colliders tagged as Obstacles) are detected.

Is this a known bug?


How large are your obstacles?
By default the grid graph doesn’t check everything inside the tile because it uses a capsule to check it (and a capsule cannot cover a square tile precisely).

Maybe this is the issue?

The obstacles are simply 1x1. I have also tried 0.9 x 0.9 size. I followed the example 2D project exactly.

In fact I can confirm the same issue occurs with that project. Load up Example15_2D, change the graph size to 50x50, and it stops detecting all obstacles.

I really hope this supports larger grid sizes because I was planning on a 100 x 100 grid for my game.

That particular case is because setting the size to 50x50 causes the node centers to lie between the colliders, and that example scene uses the ‘Point’ collision detection mode, so it only checks if the center of the node is obstructed.

Offsetting the graph by 0.5 units along each axis, or using a 51x51 graph works perfectly fine for that scene.

That did the trick. Thanks!