I manually update the position of nodes by following the Using direct access to graph data section of the documentation as such:
AstarPath.active.AddWorkItem(new AstarWorkItem(ctx => {
for (int p = 0; p < z; p++) {
G.gridGraph[i].GetNode(x[p], y[p]).position.y = (int)(height[p]);
G.gridGraph[i].CalculateConnectionsForCellAndNeighbours(x[p], y[p]);
}
}));
AstarPath.active.FlushWorkItems();
This sets the y-value of the nodes correctly, but some of them lose connection to the neighboring nodes, thereby creating a tear in the graph:
The nodes with the red dots are the ones I modified. The tear seems to appear only at the top row of modified nodes. How can I reconnect those nodes?