Newly created node connections cannot be pathfinded

Hi
There are some issues in my project that confuse me.
I have an empty GridGraph ,then I connect the nodes I want through code.
The agent was found from A to B
Now, Disconnect a node paris, then agent go and stop at the node witch disconnect.So far is good.
Then reconnection node paris, Agent can’t find the connect. and debug know that the path of agent only has start point. No matter how I call the search path.

But if it’s not relevant to other node call “clearConnect”, the agent is able to find the node again.

you would have to redo all of the previous connections that the last node removed had. from the point closer to the start point and to the node closer to the end point. im not sure if path will rebuild automatically just by readding a removed node you would probably have to recalculate it

In another clean project, it works. And in error project,I find Area debug drawing has Incorrect
color.There are not same color with two part witch be cut of connect

Can you show us the code you’re having issues with?

I’ve determined that this is again caused by the addition of off-mesh link in the process.

I am sure about thar problem at AddLink2 after disconnect node;But people don’t understand how to fix it.

        if (AstarPath.active)
        {
            var node = GetPathNode();
            node.GetConnections((x) =>
            {
                **// AddLink2(node, x);**
                GraphNode.Disconnect(node, x);
            });
 
            node.ClearConnections();
        }

        RepathWork();

Hi, I’m sorry I’m not fully understanding, are you saying you still need assistance figuring this out? And it looks like you’ve narrowed the issue down to this disconnect?