Hello,
I’m running into some issues updating nodes tags on my grid graph. For context the game is a city builder, and I am trying to change a tag when a path is placed.
I initially tried by using a GraphUpdateScene object, this works to update the node penalties (ground has penalty of 25k by default), but does not change the tag. I then tried the following code:
// located in start method of a script placed on the path object
GraphUpdateObject guo = new GraphUpdateObject(GetComponent<BoxCollider>().bounds);
guo.modifyTag = true;
guo.setTag = 1; // basic ground is tag 0, path is tag 1
guo.addPenalty = 0;
AstarPath.active.UpdateGraphs(guo);
AstarPath.active.Scan();
and had the same result, updated penalties but no updated tags. I’ve made sure that the layer my path object is in is in the layer mask for height testing, and that the bounds of the path are set up to be large enough. Any ideas?
Cheers
After a scan with graph colouring set to penalties
Same with graph colouring set to tags