Pick up position that is not locked

I have question as to how I get the closest position to a point that is not blocked by the BlockManager?


You could use a custom NNConstraint.

public class MyNNConstraint : NNConstraint {
	public ITraversalProvider provider;
	public override bool Suitable (GraphNode node) {
		return base.Suitable(node) && provider.CanTraverse(null, node);
var nn = new MyNNConstraint();
nn.provider = new BlockManager.TraversalProvider(myBlockManager, blockMode, selector);
var closestNode = AstarPath.active.GetNearest(somePosition, nn).node;