Problem with A* 2D physics unwakable nodes

Hi! I just started using A* pathfinding but i have a problem with making the grid for the ai.
So I have two tile maps, one for the walls around the map and one for obstacles inside of it. Both have a their own layer which I have put in “Obstacle layer mask” in the Pathfinder script.



But as you can see the unwalkable nodes does not follow the collider, they spread out and take up a much bigger portion than I want them too. Im guessing im doing something wrong but after some hours I cant wrap my head around what.

Thanks you!

Hi

The default collision check is a circle with exactly the same diameter as the node. This can make it just touch an adjacent collider. Try to reduce the A* Inspector → Grid Graph → Collision Check → Diameter setting to 0.9 or something like that.

1 Like

Hmm, using 0.9 gave the exact same result but 0.8 made it perfect, thank you so much for the help!