Hi all.
I have my world set up with a grid graph that has a high default penalty to encourage the use of footpaths by AI, which have a low penalty when placed. I then have gameObjects with a seeker attached to move about the world.
The issue I am encountering is if I place a path on a node that is occupied by a seeker (with a collider) it does not adjust the penalty for that node. I have made sure that the seeker gameObject is in a layer that is excluded from A* collision testing and checked that it is not set to modify any of the tag penalties. See screenshots below:
The world with high default penalty and Seeker in the middle.
The updated penalties after paths placed around and under seeker, note no change in penalty for node under seeker.
The settings for A* collision testing:
The settings for the seeker:
And this is how I change the penalty and tag of a node:
if (AstarPath.active != null) { //Paths only take up one tile, so just find the nearest node and update it GraphNode node = AstarPath.active.GetNearest(transform.position).node; if (node != null) { node.Tag = 1; node.Penalty = 0; } }
Is there anyway to set it so the Seeker is ignored when updating the tag penalties?
Thanks!