I’ve implemented a tilemap into my 2D scene using the Unity Tilemap asset. When I setup the tilemap to use a “Tilemap Collider 2D” (equivalent of a box collider per tile) the A* grid seems to work great.
However, if I set the tilemap to use a composite collider (changing the box collider per tile setting to 1 collider per shape (not tile)), the A* grid is unable to show the walk and no walk areas (only walk areas show).
It would be nice to be able to utilize composite colliders as it reduces the number of collision areas on the screen, thus making it a bit lighter on cpu utilization.
I know this is an old post, but I was also trying this today and realized the issue I was having. By default, the composite collider uses “Outlines” for its “Geometry Type” attribute. If you change this to “Polygons”, it may work for you. This seems to fix the issue if the graph wasn’t working properly if the node collider was able to fit entirely within an obstacle.
I think the issue is that CompositeCollider2D -> Geometry Type = Outlines has to be changed to Polygons. The reason is that if only outlines are generated then the physics engine cannot distinguish between inside and outside the collider. So things like Physics2D.OverlapPoint will return true even inside the collider.
I can’t seem to get this working either. I feel I’ve setup exactly like you said. Not sure if it matters but I have multiple tilemap layers. Two have obstacles. I’ve testing with one atm. All areas are walkable. It’s recognizing the colliders. Version 2019.4.6f1
This works but, in our case, it gave us other problems (the player getting stucked in one way platforms for example).
An alternative I found is setting a higher value in surface arc in the effector.