A* not detecting 2D colliders on isometric map

Hi, I’ve looked through most every related thread on this subject, and I’ve tried many of the suggested solutions on this forum, but nothing has helped me.

I’ve uploaded an imgur album of my current situation: https://imgur.com/a/X939jF6.

To begin with, I have this test tilemap. The green polygons represent my 2D colliders, and everywhere else should be walkable. You will notice that there is a blue overlay on the map, which is the Pathfinder component determining that the entire map is walkable. The expected behavior is red squares where the green collisions are. Other threads on this subject have claimed that A* will only work with the Composite Collider 2D geometry type setting “Polygons,” so I changed that option but it still isn’t being recognized as non-walkable. The collider is on its own layer, TileCollision, which is referenced as the obstacle layer mask by the Pathfinder component. I have also tried this with and without the Composite Collider 2D and with/without 2D physics. Someone on this forum suggested enabling 3D physics for my 2D game, and then doing 3D circle collision checking, but I was unable to figure out how to do this so I didn’t attempt it.

If you have any questions please let me know, I’m just a bit perplexed because I seem to have taken into account everything that previous posters have, yet it’s not working for me. Thanks for any help.

I’m not sure what’s going on…
Does it work with normal 2D colliders? Do the normal 2D example scenes work?

I think I just discovered the reason for this. I have a prefab for each tilemap that I’m going to load in, there will always be exactly one in the scene. The parent tilemap contains the A* component, and each child represents the tile information for that tile height. There is also a child for the collision layer, with all the colliders attached. It looks like this in the prefab viewer https://i.gyazo.com/4c031a28ccca120f9534bb8283f530ca.png. The problem seems to be that when I’m in prefab editing mode, the graph scanning doesn’t appear to work. When I drag the prefab into the scene and then scan, it works.

I’m imagining now that this will work fine, and all I’ll have to do is call AstarPath.active.Scan() when I load each new tilemap. If that’s not the case I’ll come back here with a few more questions!

1 Like