2D grid offset on the y axis

Hi ! I love this pathfinding and I think this is the best pathfinding in Unity. But I have a common trouble, is there a way to make an offset in the grid graph before scanning ?

Thank you for the kind words.

What do you mean by offset in this case?

when i scan my surroundings it perfectly scans the air as blue and the interior of the grpund as non-walkable. But in my movement script for enemies, there are areas on the slopes where they are not walkable. And I would like the blue zone to be more anchored in the ground to overcome this problem.

Do you have a screenshot of this? I’m afraid I still don’t quite understand.


See, there are white areas outside the 2D collider. And even if I decrease the size of the nodes, this issue will still persist.

Hi

The graph uses collision to determine which tiles are walkable and which ones are not. In your case it looks like your tilemap collider is pretty far inset compared to what the slope actually looks like. I’d look into changing that instead of the graph, as the graph itself seems to approximate the collider pretty well.

You can also tweak the Grid Graph → Collision Testing settings to make the graph be more or less conservative in where it places walkable nodes.