A node in a LayerGridGraph contained a connection to a destroyed LevelGridNode. 4.3.91

Hi Aron,

I sent you by email a package to reproduce the following issue.
The error seems to appear when the GridMover triggers a graph update while an async graph update is already running and colliders are enable or disable.
I think it’s also related to Exception when updating layered grid graph in 4.3.88 - General - Support Forum

How to reproduce:
Create a project with version 4.3.91 and the sample
Extract the package
Open the scene: GridMoveAndGraphUpdateError
Play
The graph updates every 2 seconds.

The stacktrace:

InvalidOperationException: A node in a LayerGridGraph contained a connection to a destroyed LevelGridNode.
Pathfinding.HierarchicalGraph+JobRecalculateComponents+<>c.<FindHierarchicalNodeChildren>b__12_0 (Pathfinding.GraphNode neighbour, Pathfinding.HierarchicalGraph+JobRecalculateComponents+Context& context) (at ./Library/PackageCache/com.arongranberg.astar@4.3.91/Core/Pathfinding/HierarchicalGraph.cs:442)
Pathfinding.LevelGridNode.GetConnections[T] (Pathfinding.GraphNode+GetConnectionsWithData`1[T] action, T& data, System.Int32 connectionFilter) (at ./Library/PackageCache/com.arongranberg.astar@4.3.91/Graphs/Nodes/LevelGridNode.cs:175)
Pathfinding.HierarchicalGraph+JobRecalculateComponents.FindHierarchicalNodeChildren (Pathfinding.HierarchicalGraph hGraph, System.Int32 hierarchicalNode, Pathfinding.GraphNode startNode) (at ./Library/PackageCache/com.arongranberg.astar@4.3.91/Core/Pathfinding/HierarchicalGraph.cs:444)
Pathfinding.HierarchicalGraph+JobRecalculateComponents.Execute () (at ./Library/PackageCache/com.arongranberg.astar@4.3.91/Core/Pathfinding/HierarchicalGraph.cs:537)
Unity.Jobs.IJobExtensions+JobStruct`1[T].Execute (T& data, System.IntPtr additionalPtr, System.IntPtr bufferRangePatchData, Unity.Jobs.LowLevel.Unsafe.JobRanges& ranges, System.Int32 jobIndex) (at <f7237cf7abef49bfbb552d7eb076e422>:0)

Best regards

Edit: I forgot to mention that colliders are enable or disable every frame in the sample scene.

Hi

Thanks! I have managed to replicate this, and a fix will be included in the next beta.

1 Like