2D Node types configuration

Is it possible with tags, setting node types, etc to define which nodes can connect to which others. For example, if I have a 2d grid where one of the node types is type ‘a’, it could link to other type ‘a’ and type ‘b’ nodes but not type ‘c’. However, type ‘b’ nodes could link to ‘a’, ‘b’ and ‘c’?

This is only possible with a custom grid graph rule. See Grid Graph Rules - A* Pathfinding Project

Thanks! I looked into but I wasn’t able to figure out how to make a custom grid rule to do this so I ended up figuring out another way to handle this. However, I am using the below to update the graph and I am finding some unusual behavior.

Bounds bounds = astarCollider.bounds;
AstarPath.active.UpdateGraphs(bounds);

When scanning a specific area using the bounds it will say an area is not connected. However, when I use the UI button in the Pathfinder script to scan and the same area is updated, the area is connected.

I have also tried using AstarPath.active.Scan() to scan the whole grid and I find that the first scan I do updates the connection but when I try to scan again, any new connections stay unconnected. However, when I go to the button in the script again and scan those same connections are made.

Hi

That’s odd. Calling Scan will recalculate the graph completely from scratch. It is identical to pressing the Scan button in the inspector. Are you sure nothing else is interfering?

How are you making your custom changes to the graph? It could be that this code requires some extra buffer around the obstacle in order for it to be recalculated correctly?