-
A* version: [5.46]
-
Unity version: [6000.0.59f2]
I’m a bit confused the relationship between a path that was calculated and the path.traversalConstraint.filter being applied to said path.
My goal is to make a FollowerEntity pursue a path, and then add the path’s nodes to a filter so that other Entities will choose different paths/nodes.
public FollowerEntity ai;
public Transform target;
//Start Function
var blockedNodes = new HashSet();
ABPath path = ABPath.Construct(transform.position, target.position);
path.traversalConstraint.filter = (GraphNode node) => !blockedNodes.Contains(node);
AstarPath.StartPath(path, true);
path.BlockUntilCalculated();
ai.SetPath(path);
foreach (var node in path.path)
{
blockedNodes.Add(node);
}
When the games runs the Follower starts to follow the path but then stops shortly.
The FollowerEntity behaves normally (it moves to the target) when I comment out the last foreach loop that adds the blocked nodes.
If the path has been calculated then why is the filter that was set before being applied later?