Hello,
I haven’t made many updates to my Project with the A* Pathfinding Project since upgrading to A* Version 5.1.6. The project has been very stable so far, including everything related to A*.
Now, I want to upgrade from Unity 2021.3.26f1 to 6000.0.40f1. As part of that, I also updated the A* package (I deleted the old one and reinstalled it via the Package Manager).
Unfortunately, after running the game for a short while, I now get some exceptions.
IndexOutOfRangeException: System.IndexOutOfRangeException:
This Exception was thrown from a function compiled with Burst, which has limited exception support.
0x00007fff22cf294e (Unity) burst_abort
0x00007fffb071567e (2d8bb961ca9a259ef4c7321f77e629d) burst_Abort_Trampoline
0x00007fffb06989d5 (2d8bb961ca9a259ef4c7321f77e629d) Pathfinding.Path.Pathfinding.OpenCandidateConnectionBurst_00000506$BurstDirectCall.Invoke (at C:/Unity/GhoulsOfDivinityUnity6/GODProject/Library/PackageCache/com.unity.burst@7a907cf5a459/.Runtime/unknown/unknown:0)
0x00007fffb0697e4d (2d8bb961ca9a259ef4c7321f77e629d) Pathfinding.TriangleMeshNode.OpenSingleEdgeBurst(ref Pathfinding.Int3 s1, ref Pathfinding.Int3 s2, ref Pathfinding.Int3 pos, ushort pathID, uint pathNodeIndex, uint candidatePathNodeIndex, uint candidateNodeIndex, uint candidateG, ref Pathfinding.Collections.UnsafeSpan`1<Pathfinding.PathNode> pathNodes, ref Pathfinding.BinaryHeap heap, ref Pathfinding.HeuristicObjective heuristicObjective) -> void_41cdbc907828fffacc4b2a3b74c654f1 from AstarPathfindingProject, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null (at C:/Unity/GhoulsOfDivinityUnity6/GODProject/Library/PackageCache/com.unity.burst@7a907cf5a459/.Runtime/unknown/unknown:0)
0x00007fffb06970a3 (2d8bb961ca9a259ef4c7321f77e629d) 8b88a049e47d4f464e47806edffa844f
0x00000228314a1cb1 (Mono JIT Code) (wrapper managed-to-native) Pathfinding.TriangleMeshNode/Pathfinding.OpenSingleEdgeBurst_00000770$BurstDirectCall:wrapper_native_indirect_0000022BC85E4238 (intptr&,Pathfinding.Int3&,Pathfinding.Int3&,Pathfinding.Int3&,uint16,uint,uint,uint,uint,Pathfinding.Collections.UnsafeSpan`1<Pathfinding.PathNode>&,Pathfinding.BinaryHeap&,Pathfinding.HeuristicObjective&)
0x00000228314a0d1b (Mono JIT Code) Pathfinding.TriangleMeshNode/Pathfinding.OpenSingleEdgeBurst_00000770$BurstDirectCall:Invoke (Pathfinding.Int3&,Pathfinding.Int3&,Pathfinding.Int3&,uint16,uint,uint,uint,uint,Pathfinding.Collections.UnsafeSpan`1<Pathfinding.PathNode>&,Pathfinding.BinaryHeap&,Pathfinding.HeuristicObjective&)
0x00000228314a0beb (Mono JIT Code) Pathfinding.TriangleMeshNode:OpenSingleEdgeBurst (Pathfinding.Int3&,Pathfinding.Int3&,Pathfinding.Int3&,uint16,uint,uint,uint,uint,Pathfinding.Collections.UnsafeSpan`1<Pathfinding.PathNode>&,Pathfinding.BinaryHeap&,Pathfinding.HeuristicObjective&)
0x000002283149fadb (Mono JIT Code) Pathfinding.TriangleMeshNode:OpenSingleEdge (Pathfinding.Path,uint,Pathfinding.TriangleMeshNode,int,Pathfinding.Int3,uint) (at ./Packages/com.arongranberg.astar/Graphs/Nodes/TriangleMeshNode.cs:504)
0x00000228304bf68b (Mono JIT Code) Pathfinding.TriangleMeshNode:OpenAtPoint (Pathfinding.Path,uint,Pathfinding.Int3,int,uint) (at ./Packages/com.arongranberg.astar/Graphs/Nodes/TriangleMeshNode.cs:416)
0x00000228304bf563 (Mono JIT Code) Pathfinding.TriangleMeshNode:OpenAtPoint (Pathfinding.Path,uint,Pathfinding.Int3,int,uint) (at ./Packages/com.arongranberg.astar/Graphs/Nodes/TriangleMeshNode.cs:396)
0x00000228314a2203 (Mono JIT Code) Pathfinding.TriangleMeshNode:Open (Pathfinding.Path,uint,uint) (at ./Packages/com.arongranberg.astar/Graphs/Nodes/TriangleMeshNode.cs:354)
0x000002283149bed4 (Mono JIT Code) Pathfinding.Path:CalculateStep (long) (at ./Packages/com.arongranberg.astar/Core/Pathfinding/Path.cs:1106)
0x000002283149b460 (Mono JIT Code) Pathfinding.Path:Pathfinding.IPathInternals.CalculateStep (long) (at ./Packages/com.arongranberg.astar/Core/Pathfinding/Path.cs:1130)
0x00000227f8e31e06 (Mono JIT Code) Pathfinding.PathProcessor:CalculatePathsThreaded (Pathfinding.PathHandler,Pathfinding.Sync.BlockableChannel`1/Receiver<Pathfinding.Path>) (at ./Packages/com.arongranberg.astar/Core/Pathfinding/PathProcessor.cs:341)
0x00000227f8e318e3 (Mono JIT Code) Pathfinding.PathProcessor/<>c__DisplayClass27_0:<StartThreads>b__0 () (at ./Packages/com.arongranberg.astar/Core/Pathfinding/PathProcessor.cs:122)
0x00000227a82a6396 (Mono JIT Code) System.Threading.ThreadHelper:ThreadStart_Context (object)
0x00000227a82872de (Mono JIT Code) System.Threading.ExecutionContext:RunInternal (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool)
0x00000227a8286efb (Mono JIT Code) System.Threading.ExecutionContext:Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool)
0x00000227a82a619b (Mono JIT Code) System.Threading.ExecutionContext:Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object)
0x00000227a82a5f63 (Mono JIT Code) System.Threading.ThreadHelper:ThreadStart ()
0x00000226fab12e06 (Mono JIT Code) (wrapper runtime-invoke) object:runtime_invoke_void__this__ (object,intptr,intptr,intptr)
0x00007fff98bd68de (mono-2.0-bdwgc) mono_jit_runtime_invoke (at C:/build/output/Unity-Technologies/mono/mono/mini/mini-runtime.c:3445)
0x00007fff98b18404 (mono-2.0-bdwgc) do_runtime_invoke (at C:/build/output/Unity-Technologies/mono/mono/metadata/object.c:3068)
0x00007fff98b1b99a (mono-2.0-bdwgc) mono_runtime_delegate_try_invoke (at C:/build/output/Unity-Technologies/mono/mono/metadata/object.c:4456)
0x00007fff98b4809d (mono-2.0-bdwgc) start_wrapper_internal (at C:/build/output/Unity-Techn
Pathfinding.TriangleMeshNode+OpenSingleEdgeBurst_00000770$BurstDirectCall.Invoke (Pathfinding.Int3& s1, Pathfinding.Int3& s2, Pathfinding.Int3& pos, System.UInt16 pathID, System.UInt32 pathNodeIndex, System.UInt32 candidatePathNodeIndex, System.UInt32 candidateNodeIndex, System.UInt32 candidateG, Pathfinding.Collections.UnsafeSpan`1[Pathfinding.PathNode]& pathNodes, Pathfinding.BinaryHeap& heap, Pathfinding.HeuristicObjective& heuristicObjective) (at <092913942e604d9c955135027e8e2325>:0)
Pathfinding.TriangleMeshNode.OpenSingleEdgeBurst (Pathfinding.Int3& s1, Pathfinding.Int3& s2, Pathfinding.Int3& pos, System.UInt16 pathID, System.UInt32 pathNodeIndex, System.UInt32 candidatePathNodeIndex, System.UInt32 candidateNodeIndex, System.UInt32 candidateG, Pathfinding.Collections.UnsafeSpan`1[Pathfinding.PathNode]& pathNodes, Pathfinding.BinaryHeap& heap, Pathfinding.HeuristicObjective& heuristicObjective) (at <092913942e604d9c955135027e8e2325>:0)
Pathfinding.TriangleMeshNode.OpenSingleEdge (Pathfinding.Path path, System.UInt32 pathNodeIndex, Pathfinding.TriangleMeshNode other, System.Int32 sharedEdgeOnOtherNode, Pathfinding.Int3 pos, System.UInt32 gScore) (at ./Packages/com.arongranberg.astar/Graphs/Nodes/TriangleMeshNode.cs:491)
Pathfinding.TriangleMeshNode.OpenAtPoint (Pathfinding.Path path, System.UInt32 pathNodeIndex, Pathfinding.Int3 pos, System.Int32 edge, System.UInt32 gScore) (at ./Packages/com.arongranberg.astar/Graphs/Nodes/TriangleMeshNode.cs:416)
Pathfinding.TriangleMeshNode.OpenAtPoint (Pathfinding.Path path, System.UInt32 pathNodeIndex, Pathfinding.Int3 pos, System.Int32 edge, System.UInt32 gScore) (at ./Packages/com.arongranberg.astar/Graphs/Nodes/TriangleMeshNode.cs:396)
Pathfinding.TriangleMeshNode.Open (Pathfinding.Path path, System.UInt32 pathNodeIndex, System.UInt32 gScore) (at ./Packages/com.arongranberg.astar/Graphs/Nodes/TriangleMeshNode.cs:353)
Pathfinding.Path.CalculateStep (System.Int64 targetTick) (at ./Packages/com.arongranberg.astar/Core/Pathfinding/Path.cs:1102)
Pathfinding.Path.Pathfinding.IPathInternals.CalculateStep (System.Int64 targetTick) (at ./Packages/com.arongranberg.astar/Core/Pathfinding/Path.cs:1130)
Pathfinding.PathProcessor.CalculatePathsThreaded (Pathfinding.PathHandler pathHandler, Pathfinding.Sync.BlockableChannel`1+Receiver[T] receiver) (at ./Packages/com.arongranberg.astar/Core/Pathfinding/PathProcessor.cs:339)
UnityEngine.Debug:LogException(Exception)
Pathfinding.PathProcessor:CalculatePathsThreaded(PathHandler, Receiver) (at ./Packages/com.arongranberg.astar/Core/Pathfinding/PathProcessor.cs:389)
Pathfinding.<>c__DisplayClass27_0:<StartThreads>b__0() (at ./Packages/com.arongranberg.astar/Core/Pathfinding/PathProcessor.cs:122)
System.Threading.ThreadHelper:ThreadStart()
At first, I thought this might happen even in the 2021.3.26f1 version when using the newest A* package — but that’s not the case. In that version, I only get a single error, and everything works except for NavmeshCuts.
The NavmeshCut component requires Unity 2022.3 or newer to work, due to Unity bugs in earlier versions. Please update Unity to 2022.3.21 or later, if you want to use navmesh cutting.
So my questions are:
- Is this issue caused by the new Unity version?
- What can I do to fix it?
Thanks!