GridGraph has tear after node update

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:

Screenshot at 2021-01-12 10:53:07

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?

Hi

If you call CalculateConnections... then it will calculate the connections using the grid graph settings. In this particular case you might want to change the ‘max climb’ setting on the grid graph. You can also simply not recalculate the connections I supppose.

Thanks Aron, simply not recalculating did the trick perfectly.