Support Forum

The nearest to the end point walkable node can not be found with ITraversalProvider!

Hi, Aron!

I am using the awesome ITraversalProvider interface in my turn-based game. So far it’s great help.
However, when I am trying to search for a path to a walkable node that is blocked via ITraversalProvider , it returns an empty array. Shouldn’t it look for an alternative path instead? (to a closest walkable node on graph)

So the question is, how can I get the path to the nearest available (walkable) node on graph while still using ITraversalProvider blocking system? I love it and would like to keep the functionality.

This is my solution from reading other topic of same problem, but it does’t work.

Thank you.

Example of requesting path:

public class MyNNConstraint : PathNNConstraint {
	public override bool Suitable (GraphNode node) {
		return base.Suitable(node);
	}
}

void getPath
{
    Path p = ABPath.Construct(start, end, null);
    p.traversalProvider = mytraversalProvider ;
    MyNNConstraint MyNNconstraint = new MyNNConstraint();
     p.nnConstraint = MyNNconstraint ;
     seeker.Startpath(p);
}