4.3.92 Proc grid mover bug?

Hello again,

I recently updated to 4.3.92 and have been getting these errors:

IndexOutOfRangeException: Index was outside the bounds of the array.
  at Pathfinding.GridNode.GetConnections[T] (Pathfinding.GraphNode+GetConnectionsWithData`1[T] action, T& data, System.Int32 connectionFilter) [0x00000] in <00000000000000000000000000000000>:0 
  at Pathfinding.HierarchicalGraph+JobRecalculateComponents.FindHierarchicalNodeChildren (Pathfinding.HierarchicalGraph hGraph, System.Int32 hierarchicalNode, Pathfinding.GraphNode startNode) [0x00000] in <00000000000000000000000000000000>:0 
  at Pathfinding.HierarchicalGraph+JobRecalculateComponents.Execute () [0x00000] in <00000000000000000000000000000000>:0 

NullReferenceException: Object reference not set to an instance of an object.
  at Pathfinding.HierarchicalGraph+JobRecalculateComponents.Execute () [0x00000] in <00000000000000000000000000000000>:0 

Thats the error i get in builds (Pc, webgl, android, etc.).

In editor i get these errors spamming:

Pathfinding.GridNode.GetConnections[T] (Pathfinding.GraphNode+GetConnectionsWithData`1[T] action, T& data, System.Int32 connectionFilter) (at ./Library/PackageCache/com.arongranberg.astar@4.3.92/Graphs/Nodes/GridNode.cs:190)
Pathfinding.HierarchicalGraph+JobRecalculateComponents.FindHierarchicalNodeChildren (Pathfinding.HierarchicalGraph hGraph, System.Int32 hierarchicalNode, Pathfinding.GraphNode startNode) (at ./Library/PackageCache/com.arongranberg.astar@4.3.92/Core/Pathfinding/HierarchicalGraph.cs:444)
Pathfinding.HierarchicalGraph+JobRecalculateComponents.Execute () (at ./Library/PackageCache/com.arongranberg.astar@4.3.92/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 <30adf90198bc4c4b83910c6fb1877998>:0)

and

Pathfinding.GridNode.GetConnections[T] (Pathfinding.GraphNode+GetConnectionsWithData`1[T] action, T& data, System.Int32 connectionFilter) (at ./Library/PackageCache/com.arongranberg.astar@4.3.92/Graphs/Nodes/GridNode.cs:190)
Pathfinding.GraphNode.GetConnections (System.Action`1[T] action, System.Int32 connectionFilter) (at ./Library/PackageCache/com.arongranberg.astar@4.3.92/Core/Nodes/GraphNode.cs:416)
Pathfinding.Util.GraphGizmoHelper.DrawConnections (Pathfinding.GraphNode node) (at ./Library/PackageCache/com.arongranberg.astar@4.3.92/Utilities/GraphGizmoHelper.cs:126)
Pathfinding.GridGraph.OnDrawGizmos (Pathfinding.Drawing.DrawingData gizmos, System.Boolean drawNodes, Pathfinding.Drawing.RedrawScope redrawScope) (at ./Library/PackageCache/com.arongranberg.astar@4.3.92/Graphs/GridGraph.cs:2278)
AstarPath.DrawGizmos () (at ./Library/PackageCache/com.arongranberg.astar@4.3.92/Core/AstarPath.cs:810)
Pathfinding.Drawing.DrawingManager.DrawGizmos (System.Boolean usingRenderPipeline) (at ./Library/PackageCache/com.arongranberg.astar@4.3.92/Drawing/DrawingManager.cs:600)
UnityEngine.Debug:LogException(Exception, Object)
Pathfinding.Drawing.DrawingManager:DrawGizmos(Boolean) (at ./Library/PackageCache/com.arongranberg.astar@4.3.92/Drawing/DrawingManager.cs:602)
Pathfinding.Drawing.DrawingManager:Submit(Camera, CommandBuffer, Boolean, Boolean) (at ./Library/PackageCache/com.arongranberg.astar@4.3.92/Drawing/DrawingManager.cs:650)
Pathfinding.Drawing.DrawingManager:SubmitFrame(Camera, CommandBuffer, Boolean) (at ./Library/PackageCache/com.arongranberg.astar@4.3.92/Drawing/DrawingManager.cs:484)
Pathfinding.Drawing.DrawingManager:ExecuteCustomRenderPass(ScriptableRenderContext, Camera) (at ./Library/PackageCache/com.arongranberg.astar@4.3.92/Drawing/DrawingManager.cs:417)
Pathfinding.Drawing.AlineURPRenderPass:Execute(ScriptableRenderContext, RenderingData&) (at ./Library/PackageCache/com.arongranberg.astar@4.3.92/Drawing/AlineURPRenderPassFeature.cs:16)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

It always eventually occurs when i move far enough away, but its not consistent when it occurs, for example i can move enough away from the starting position for the mover to update 1-3 times. But it eventually throws this error and then i cannot move anymore. Or sometimes i can continue moving, but it spams the 2nd NRE log

I wonder if this is in anyway related to my issue. I’m using the Procedural Graph Mover in the Beta and get similar errors once I start moving around. I’m using a Recast Graph though.

Hi

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

1 Like