hi,
I’ve been digging through the docs, trying to wrap my head around the following problem I cannot seem to solve:
I have an agent that follows along a set of waypoints (yellow dots) following the black line. Whenever it reached a waypoint the followerEntity.destination is set to the next waypoint.
Now, there is a wall (collision obstacle) on the right path, and when the agent notices it cannot move through, Astar will try to get a new path (green line) around the wall. I don’t want this so I added a GraphUpdateSceneObject which blocks the left path by setting its tag which the agent cannot traverse.
So far so good, but what I am missing here is a way to check at any point in time if the path to the current waypoint is blocked, so that I can give the agent a command to move to attack the wall, or when the wall is destroyed, to follow the path to the waypoint again.
I fail to find a way to simply check a path for this specific agent on this specific grid graph without setting the followerEntity’s destination. I cannot check for hasPath=false because I also move to a position near the wall when attacking it, hence returning hasPath=true again.
Happy for any help here, I’m stuck 
Best regards,
Daniel
I found out there is follower.SetPath(path, false)
to not overwrite the current destination but this path calculation is not what I want because it ignores tags.
Never mind, I found the missing link, I need a constraint in the path:
pathToWayPoint = ABPath.Construct(start, end, OnPathComplete);
pathToWayPoint.heuristicScale = 5f;
pathToWayPoint.enabledTags = tagMask;
pathToWayPoint.nnConstraint = NNConstraint.Walkable;
follower.SetPath(pathToWayPoint, false);
You may want to check IsPathPossible
as well 
I did but I had always problems getting it to work as described. I tried again with this:
walkableConstraint = new NNConstraint {
constrainWalkability = true,
walkable = true,
constrainTags = true,
tags = tagMask,
constrainDistance = true,
distanceMetric = DistanceMetric.ClosestAsSeenFromAboveSoft(),
graphMask = GraphMask.FromGraph(graph)
};
public GraphNode GetNearestWalkableNode(Vector3 position) {
var node = graph.GetNearest(position, walkableConstraint).node;
return node;
}
public bool IsPathPossible(Vector3 start, Vector3 end) {
var startNode = GetNearestWalkableNode(start);
var endNode = GetNearestWalkableNode(end);
return PathUtilities.IsPathPossible(startNode, endNode);
}
I just does not work. A destination on an unwalkable node returns true 
Note that if you use the walkableConstraint, then it will always find the nearest walkable node. So if your destination is on an unwalkable node, it will find the nearest walkable node and query IsPathPossible with that node. This is likely not what you want. Try setting constrainWalkability=false.
1 Like
Thanks that helped. I figured it out now…took a while longer than it should
@aron_granberg ok guess not, sorry for my ongoing confusion but I still have trouble with those methods…
Most scenarios work as I understood them but there’s one which I cannot figure out:
Looking at the map picture I posted above, GetNearest finds a node on the right side of the wall, even though this should be in another area, split by the tag of the GraphUpdateObject.
When I “Modify Walkability” to unwalkable it works and GetNearest finds a node on the left side of the wall. What am I doing wrong here? Is there sth about how I’m using tags?


Why does this return true, respectively, why does GetNearestConnectedWalkableNode return a node on the right side of the wall when it’s not on the same area? 
Hi
Tags do not create new areas, only walkability does.
This is a technical limitation, as it would otherwise be way too slow to run after every graph update (and possibly consume quite a lot of memory).
1 Like
I see thanks. Do you have any advice what’s a good solution for this problem then?
Create multiple graphs?
That’s an option, but there’s also writing your own handler/controller for area walkability, the ITraversalProvider
interface:
1 Like
Thanks I’ll check this out