Support Forum

SingleNodeBlocker how to find out node is being blocked?

I am using SingleNodeBlocker in my game.
I want to find out nodes near a node has being blocked now by singleNodeBlocker.
So I tried,

    var TargetNode = AstarPath.active.GetNearest(Target.position).node;
    TargetNode.GetConnections(otherNode => {

        if (state == State.FoundTarget)
        {
            Debug.Log("otherNode.Walkable = " + otherNode.Walkable); 
        }
    });

Even the node that is blocked by singlenodeblocker tell me Walkable to true.
This isn’t that I wanted.
How can I find out if some node is blocked or not?

Hi, you can use the SingleNodeBlocker’s manager:

var isNodeBlockedByBlocker = blocker.manager.NodeContainsAnyOf(node, new List<SingleNodeBlocker>() { blocker });