GetNodesInRegion() return no nodes!

Hi there!

I’ve been using the A* Pathfinding Project for a while now, but for some reason I haven’t been able to get the hang of the GetNodesInRegion() function…

I essentially want to get a random node around a specific point to Instantiate Loot Drops when a Boss dies.

For this, I added a CircleCollider2D to the boss, and I am using it’s bounds to try and find nodes that are walkable and nearby. For some unexplainable reason however, the GetNodesInRegion() function doesnt add any nodes to the List, and returns only null.

I haven’t been able to find anything regarding this issue in the Forum and in the Documentation, so I’m shooting my shot here!

If anyone knows what could be wrong with my code, feel free to reply!
Thanks in advance!

Hi

Your 2D collider bounding box will have zero depth along the Z axis, so the GetNodesInRegion method will not consider any notes valid to return. Expand the bbox along the z direction and it will work.