Error when generating the graphs

Hello,

I have an exception during the graph scan.
I am scanning recast graph. Unity version 6000.0.28f1, Pathfinding project version 5.4.1

The exception:

There was an error generating the graphs:
System.IndexOutOfRangeException: System.IndexOutOfRangeException: Index 8 is out of range in container of '0' Length.
This Exception was thrown from a function compiled with Burst, which has limited exception support.
0x00007fffc96aec4e (Unity) burst_abort
0x00007fffbb04507e (e562e844bb2b46ea747b5875d3c9987) burst_Abort_Trampoline
0x00007fffbb0410f1 (e562e844bb2b46ea747b5875d3c9987) Pathfinding.Graphs.Navmesh.RecastMeshGatherer.Pathfinding.Graphs.Navmesh.ConvertTreesToMeshes_00000B93$BurstDirectCall.Invoke (at ***/Library/PackageCache/com.unity.burst/.Runtime/unknown/unknown:0)
0x00007fffbb03f680 (e562e844bb2b46ea747b5875d3c9987) 71b8a59b4379b9fca11eae7c60162275
0x000001fad41c5dcf (Mono JIT Code) (wrapper managed-to-native) Pathfinding.Graphs.Navmesh.RecastMeshGatherer/Pathfinding.Graphs.Navmesh.ConvertTreesToMeshes_00000B93$BurstDirectCall:wrapper_native_indirect_000001F9BECD0D80 (intptr&,Pathfinding.Collections.UnsafeSpan`1<UnityEngine.TreeInstance>&,Unity.Mathematics.float3&,Unity.Mathematics.float3&,Pathfinding.Collections.UnsafeSpan`1<Pathfinding.Graphs.Navmesh.RecastMeshGatherer/TreeInfo>&,Unity.Collections.LowLevel.Unsafe.UnsafeList`1<Pathfinding.Graphs.Navmesh.RecastMeshGatherer/GatheredMesh>&,UnityEngine.Bounds&,Unity.Collections.LowLevel.Unsafe.UnsafeList`1<Pathfinding.Graphs.Navmesh.RecastMeshGatherer/GatheredMesh>&)
0x000001fad41c58b3 (Mono JIT Code) Pathfinding.Graphs.Navmesh.RecastMeshGatherer/Pathfinding.Graphs.Navmesh.ConvertTreesToMeshes_00000B93$BurstDirectCall:Invoke (Pathfinding.Collections.UnsafeSpan`1<UnityEngine.TreeInstance>&,Unity.Mathematics.float3&,Unity.Mathematics.float3&,Pathfinding.Collections.UnsafeSpan`1<Pathfinding.Graphs.Navmesh.RecastMeshGatherer/TreeInfo>&,Unity.Collections.LowLevel.Unsafe.UnsafeList`1<Pathfinding.Graphs.Navmesh.RecastMeshGatherer/GatheredMesh>&,UnityEngine.Bounds&,Unity.Collections.LowLevel.Unsafe.UnsafeList`1<Pathfinding.Graphs.Navmesh.RecastMeshGatherer/GatheredMesh>&)
0x000001fad41c5723 (Mono JIT Code) Pathfinding.Graphs.Navmesh.RecastMeshGatherer:ConvertTreesToMeshes (Pathfinding.Collections.UnsafeSpan`1<UnityEngine.TreeInstance>&,Unity.Mathematics.float3&,Unity.Mathematics.float3&,Pathfinding.Collections.UnsafeSpan`1<Pathfinding.Graphs.Navmesh.RecastMeshGatherer/TreeInfo>&,Unity.Collections.LowLevel.Unsafe.UnsafeList`1<Pathfinding.Graphs.Navmesh.RecastMeshGatherer/GatheredMesh>&,UnityEngine.Bounds&,Unity.Collections.LowLevel.Unsafe.UnsafeList`1<Pathfinding.Graphs.Navmesh.RecastMeshGatherer/GatheredMesh>&)
0x000001fad41bfdeb (Mono JIT Code) Pathfinding.Graphs.Navmesh.RecastMeshGatherer:CollectTreeMeshes (UnityEngine.Terrain) (at ./Library/PackageCache/com.arongranberg.astar/Graphs/Navmesh/RecastMeshGatherer.cs:1058)
0x000001fad41ada6b (Mono JIT Code) Pathfinding.Graphs.Navmesh.RecastMeshGatherer:CollectTerrainMeshes (bool,single) (at ./Library/PackageCache/com.arongranberg.astar/Graphs/Navmesh/RecastMeshGatherer.cs:616)
0x000001fad1e0c633 (Mono JIT Code) Pathfinding.Graphs.Navmesh.TileBuilder:CollectMeshes (UnityEngine.Bounds) (at ./Library/PackageCache/com.arongranberg.astar/Graphs/Navmesh/TileBuilder.cs:144)
0x000001fad1e0388b (Mono JIT Code) Pathfinding.Graphs.Navmesh.TileBuilder:Schedule (Pathfinding.Jobs.DisposeArena) (at ./Library/PackageCache/com.arongranberg.astar/Graphs/Navmesh/TileBuilder.cs:247)
0x000001fad1dff073 (Mono JIT Code) Pathfinding.RecastGraph/RecastGraphScanPromise/<Prepare>d__9:MoveNext () (at ./Library/PackageCache/com.arongranberg.astar/Graphs/RecastGraph.cs:1166)
0x000001fad1dfd5c6 (Mono JIT Code) Pathfinding.GraphUpdateProcessor:PrepareGraphUpdatePromises (System.Collections.Generic.List`1<System.ValueTuple`2<Pathfinding.IGraphUpdatePromise, System.Collections.Generic.IEnumerator`1<Unity.Jobs.JobHandle>>>,Pathfinding.Jobs.TimeSlice) (at ./Library/PackageCache/com.arongranberg.astar/Core/Pathfinding/GraphUpdateProcessor.cs:238)
0x000001fad1df212b (Mono JIT Code) AstarPath/<ScanInternal>d__133:MoveNext () (at ./Library/PackageCache/com.arongranberg.astar/Core/AstarPath.cs:1831)
0x000001fa877bd8af (Mono JIT Code) AstarPath/<TickAsyncScanUntilCompletion>d__130:MoveNext () (at ./Library/PackageCache/com.arongranberg.astar/Core/AstarPath.cs:1697)
0x000001fa877bca9f (Mono JIT Code) Pathfinding.AstarPathEditor:MenuScan () (at ./Library/PackageCache/com.arongranberg.astar/Editor/AstarPathEditor.cs:1292)
0x000001fa877bc3f1 (Mono JIT Code) Pathfinding.AstarPathEditor/<>c__DisplayClass74_0:<RunTask>b__0 () (at ./Library/PackageCache/com.arongranberg.astar/Editor/AstarPathEditor.cs:788)
0x000001fa6c9f76c8 (Mono JIT Code) UnityEditor.EditorApplication:Internal_CallUpdateFunctions ()
0x000001fab298fae5 (Mono JIT Code) (wrapper runtime-invoke) object:runtime_invoke_void (object,intptr,intptr,intptr)
0x00007fffc6b3699e (mono-2.0-bdwgc) mono_jit_runtime_invoke (at C:/build/output/Unity-Technologies/mono/mono/mini/mini-runtime.c:3445)
0x00007fffc6a78444 (mono-2.0-bdwgc) do_runtime_invoke (at C:/build/output/Unity-Technologies/mono/mono/metadata/object.c:3068)
0x00007fffc6a78530 (mono-2.0-bdwgc) mono_runtime_invoke (at C:/build/output/Unity-Technologies/mono/mono/
  at (wrapper managed-to-native) Pathfinding.Graphs.Navmesh.RecastMeshGatherer+ConvertTreesToMeshes_00000B93$BurstDirectCall.wrapper_native_indirect_000001F9BECD0D80(intptr&,Pathfinding.Collections.UnsafeSpan`1<UnityEngine.TreeInstance>&,Unity.Mathematics.float3&,Unity.Mathematics.float3&,Pathfinding.Collections.UnsafeSpan`1<Pathfinding.Graphs.Navmesh.RecastMeshGatherer/TreeInfo>&,Unity.Collections.LowLevel.Unsafe.UnsafeList`1<Pathfinding.Graphs.Navmesh.RecastMeshGatherer/GatheredMesh>&,UnityEngine.Bounds&,Unity.Collections.LowLevel.Unsafe.UnsafeList`1<Pathfinding.Graphs.Navmesh.RecastMeshGatherer/GatheredMesh>&)
  at Pathfinding.Graphs.Navmesh.RecastMeshGatherer+ConvertTreesToMeshes_00000B93$BurstDirectCall.Invoke (Pathfinding.Collections.UnsafeSpan`1[UnityEngine.TreeInstance]& treeInstances, Unity.Mathematics.float3& terrainPos, Unity.Mathematics.float3& terrainSize, Pathfinding.Collections.UnsafeSpan`1[Pathfinding.Graphs.Navmesh.RecastMeshGatherer+TreeInfo]& treeInfos, Unity.Collections.LowLevel.Unsafe.UnsafeList`1[Pathfinding.Graphs.Navmesh.RecastMeshGatherer+GatheredMesh]& allSubmeshes, UnityEngine.Bounds& graphBounds, Unity.Collections.LowLevel.Unsafe.UnsafeList`1[Pathfinding.Graphs.Navmesh.RecastMeshGatherer+GatheredMesh]& meshes) [0x0000f] in <ce47e574011f4248a2ea7d1e748188a4>:0 
  at Pathfinding.Graphs.Navmesh.RecastMeshGatherer.ConvertTreesToMeshes (Pathfinding.Collections.UnsafeSpan`1[UnityEngine.TreeInstance]& treeInstances, Unity.Mathematics.float3& terrainPos, Unity.Mathematics.float3& terrainSize, Pathfinding.Collections.UnsafeSpan`1[Pathfinding.Graphs.Navmesh.RecastMeshGatherer+TreeInfo]& treeInfos, Unity.Collections.LowLevel.Unsafe.UnsafeList`1[Pathfinding.Graphs.Navmesh.RecastMeshGatherer+GatheredMesh]& allSubmeshes, UnityEngine.Bounds& graphBounds, Unity.Collections.LowLevel.Unsafe.UnsafeList`1[Pathfinding.Graphs.Navmesh.RecastMeshGatherer+GatheredMesh]& meshes) <0x1fad41c5690 + 0x00092> in <ce47e574011f4248a2ea7d1e748188a4>:0 
  at Pathfinding.Graphs.Navmesh.RecastMeshGatherer.CollectTreeMeshes (UnityEngine.Terrain terrain) [0x002e0] in .\Library\PackageCache\com.arongranberg.astar\Graphs\Navmesh\RecastMeshGatherer.cs:1058 
  at Pathfinding.Graphs.Navmesh.RecastMeshGatherer.CollectTerrainMeshes (System.Boolean rasterizeTrees, System.Single desiredChunkSize) [0x00063] in .\Library\PackageCache\com.arongranberg.astar\Graphs\Navmesh\RecastMeshGatherer.cs:616 
  at Pathfinding.Graphs.Navmesh.TileBuilder.CollectMeshes (UnityEngine.Bounds bounds) [0x0015d] in .\Library\PackageCache\com.arongranberg.astar\Graphs\Navmesh\TileBuilder.cs:144 
  at Pathfinding.Graphs.Navmesh.TileBuilder.Schedule (Pathfinding.Jobs.DisposeArena arena) [0x00077] in .\Library\PackageCache\com.arongranberg.astar\Graphs\Navmesh\TileBuilder.cs:247 
  at Pathfinding.RecastGraph+RecastGraphScanPromise+<Prepare>d__9.MoveNext () [0x00122] in .\Library\PackageCache\com.arongranberg.astar\Graphs\RecastGraph.cs:1166 
  at Pathfinding.GraphUpdateProcessor.PrepareGraphUpdatePromises (System.Collections.Generic.List`1[T] promises, Pathfinding.Jobs.TimeSlice timeSlice) [0x0010f] in .\Library\PackageCache\com.arongranberg.astar\Core\Pathfinding\GraphUpdateProcessor.cs:244 
  at AstarPath+<ScanInternal>d__133.MoveNext () [0x004c5] in .\Library\PackageCache\com.arongranberg.astar\Core\AstarPath.cs:1836 
  at AstarPath+<TickAsyncScanUntilCompletion>d__130.MoveNext () [0x00060] in .\Library\PackageCache\com.arongranberg.astar\Core\AstarPath.cs:1700 
  at Pathfinding.AstarPathEditor.MenuScan () [0x0008e] in .\Library\PackageCache\com.arongranberg.astar\Editor\AstarPathEditor.cs:1292 

If you think this is a bug, please contact me on forum.arongranberg.com (post a new thread)

UnityEngine.Debug:LogError (object)
Pathfinding.AstarPathEditor:MenuScan () (at ./Library/PackageCache/com.arongranberg.astar/Editor/AstarPathEditor.cs:1305)
Pathfinding.AstarPathEditor/<>c__DisplayClass74_0:<RunTask>b__0 () (at ./Library/PackageCache/com.arongranberg.astar/Editor/AstarPathEditor.cs:788)
UnityEditor.EditorApplication:Internal_CallUpdateFunctions ()There was an error generating the graphs:
System.IndexOutOfRangeException: System.IndexOutOfRangeException: Index 8 is out of range in container of '0' Length.
This Exception was thrown from a function compiled with Burst, which has limited exception support.
0x00007fffc96aec4e (Unity) burst_abort
0x00007fffbb04507e (e562e844bb2b46ea747b5875d3c9987) burst_Abort_Trampoline
0x00007fffbb0410f1 (e562e844bb2b46ea747b5875d3c9987) Pathfinding.Graphs.Navmesh.RecastMeshGatherer.Pathfinding.Graphs.Navmesh.ConvertTreesToMeshes_00000B93$BurstDirectCall.Invoke (at ***/Library/PackageCache/com.unity.burst/.Runtime/unknown/unknown:0)
0x00007fffbb03f680 (e562e844bb2b46ea747b5875d3c9987) 71b8a59b4379b9fca11eae7c60162275
0x000001fad41c5dcf (Mono JIT Code) (wrapper managed-to-native) Pathfinding.Graphs.Navmesh.RecastMeshGatherer/Pathfinding.Graphs.Navmesh.ConvertTreesToMeshes_00000B93$BurstDirectCall:wrapper_native_indirect_000001F9BECD0D80 (intptr&,Pathfinding.Collections.UnsafeSpan`1<UnityEngine.TreeInstance>&,Unity.Mathematics.float3&,Unity.Mathematics.float3&,Pathfinding.Collections.UnsafeSpan`1<Pathfinding.Graphs.Navmesh.RecastMeshGatherer/TreeInfo>&,Unity.Collections.LowLevel.Unsafe.UnsafeList`1<Pathfinding.Graphs.Navmesh.RecastMeshGatherer/GatheredMesh>&,UnityEngine.Bounds&,Unity.Collections.LowLevel.Unsafe.UnsafeList`1<Pathfinding.Graphs.Navmesh.RecastMeshGatherer/GatheredMesh>&)
0x000001fad41c58b3 (Mono JIT Code) Pathfinding.Graphs.Navmesh.RecastMeshGatherer/Pathfinding.Graphs.Navmesh.ConvertTreesToMeshes_00000B93$BurstDirectCall:Invoke (Pathfinding.Collections.UnsafeSpan`1<UnityEngine.TreeInstance>&,Unity.Mathematics.float3&,Unity.Mathematics.float3&,Pathfinding.Collections.UnsafeSpan`1<Pathfinding.Graphs.Navmesh.RecastMeshGatherer/TreeInfo>&,Unity.Collections.LowLevel.Unsafe.UnsafeList`1<Pathfinding.Graphs.Navmesh.RecastMeshGatherer/GatheredMesh>&,UnityEngine.Bounds&,Unity.Collections.LowLevel.Unsafe.UnsafeList`1<Pathfinding.Graphs.Navmesh.RecastMeshGatherer/GatheredMesh>&)
0x000001fad41c5723 (Mono JIT Code) Pathfinding.Graphs.Navmesh.RecastMeshGatherer:ConvertTreesToMeshes (Pathfinding.Collections.UnsafeSpan`1<UnityEngine.TreeInstance>&,Unity.Mathematics.float3&,Unity.Mathematics.float3&,Pathfinding.Collections.UnsafeSpan`1<Pathfinding.Graphs.Navmesh.RecastMeshGatherer/TreeInfo>&,Unity.Collections.LowLevel.Unsafe.UnsafeList`1<Pathfinding.Graphs.Navmesh.RecastMeshGatherer/GatheredMesh>&,UnityEngine.Bounds&,Unity.Collections.LowLevel.Unsafe.UnsafeList`1<Pathfinding.Graphs.Navmesh.RecastMeshGatherer/GatheredMesh>&)
0x000001fad41bfdeb (Mono JIT Code) Pathfinding.Graphs.Navmesh.RecastMeshGatherer:CollectTreeMeshes (UnityEngine.Terrain) (at ./Library/PackageCache/com.arongranberg.astar/Graphs/Navmesh/RecastMeshGatherer.cs:1058)
0x000001fad41ada6b (Mono JIT Code) Pathfinding.Graphs.Navmesh.RecastMeshGatherer:CollectTerrainMeshes (bool,single) (at ./Library/PackageCache/com.arongranberg.astar/Graphs/Navmesh/RecastMeshGatherer.cs:616)
0x000001fad1e0c633 (Mono JIT Code) Pathfinding.Graphs.Navmesh.TileBuilder:CollectMeshes (UnityEngine.Bounds) (at ./Library/PackageCache/com.arongranberg.astar/Graphs/Navmesh/TileBuilder.cs:144)
0x000001fad1e0388b (Mono JIT Code) Pathfinding.Graphs.Navmesh.TileBuilder:Schedule (Pathfinding.Jobs.DisposeArena) (at ./Library/PackageCache/com.arongranberg.astar/Graphs/Navmesh/TileBuilder.cs:247)
0x000001fad1dff073 (Mono JIT Code) Pathfinding.RecastGraph/RecastGraphScanPromise/<Prepare>d__9:MoveNext () (at ./Library/PackageCache/com.arongranberg.astar/Graphs/RecastGraph.cs:1166)
0x000001fad1dfd5c6 (Mono JIT Code) Pathfinding.GraphUpdateProcessor:PrepareGraphUpdatePromises (System.Collections.Generic.List`1<System.ValueTuple`2<Pathfinding.IGraphUpdatePromise, System.Collections.Generic.IEnumerator`1<Unity.Jobs.JobHandle>>>,Pathfinding.Jobs.TimeSlice) (at ./Library/PackageCache/com.arongranberg.astar/Core/Pathfinding/GraphUpdateProcessor.cs:238)
0x000001fad1df212b (Mono JIT Code) AstarPath/<ScanInternal>d__133:MoveNext () (at ./Library/PackageCache/com.arongranberg.astar/Core/AstarPath.cs:1831)
0x000001fa877bd8af (Mono JIT Code) AstarPath/<TickAsyncScanUntilCompletion>d__130:MoveNext () (at ./Library/PackageCache/com.arongranberg.astar/Core/AstarPath.cs:1697)
0x000001fa877bca9f (Mono JIT Code) Pathfinding.AstarPathEditor:MenuScan () (at ./Library/PackageCache/com.arongranberg.astar/Editor/AstarPathEditor.cs:1292)
0x000001fa877bc3f1 (Mono JIT Code) Pathfinding.AstarPathEditor/<>c__DisplayClass74_0:<RunTask>b__0 () (at ./Library/PackageCache/com.arongranberg.astar/Editor/AstarPathEditor.cs:788)
0x000001fa6c9f76c8 (Mono JIT Code) UnityEditor.EditorApplication:Internal_CallUpdateFunctions ()
0x000001fab298fae5 (Mono JIT Code) (wrapper runtime-invoke) object:runtime_invoke_void (object,intptr,intptr,intptr)
0x00007fffc6b3699e (mono-2.0-bdwgc) mono_jit_runtime_invoke (at C:/build/output/Unity-Technologies/mono/mono/mini/mini-runtime.c:3445)
0x00007fffc6a78444 (mono-2.0-bdwgc) do_runtime_invoke (at C:/build/output/Unity-Technologies/mono/mono/metadata/object.c:3068)
0x00007fffc6a78530 (mono-2.0-bdwgc) mono_runtime_invoke (at C:/build/output/Unity-Technologies/mono/mono/
  at (wrapper managed-to-native) Pathfinding.Graphs.Navmesh.RecastMeshGatherer+ConvertTreesToMeshes_00000B93$BurstDirectCall.wrapper_native_indirect_000001F9BECD0D80(intptr&,Pathfinding.Collections.UnsafeSpan`1<UnityEngine.TreeInstance>&,Unity.Mathematics.float3&,Unity.Mathematics.float3&,Pathfinding.Collections.UnsafeSpan`1<Pathfinding.Graphs.Navmesh.RecastMeshGatherer/TreeInfo>&,Unity.Collections.LowLevel.Unsafe.UnsafeList`1<Pathfinding.Graphs.Navmesh.RecastMeshGatherer/GatheredMesh>&,UnityEngine.Bounds&,Unity.Collections.LowLevel.Unsafe.UnsafeList`1<Pathfinding.Graphs.Navmesh.RecastMeshGatherer/GatheredMesh>&)
  at Pathfinding.Graphs.Navmesh.RecastMeshGatherer+ConvertTreesToMeshes_00000B93$BurstDirectCall.Invoke (Pathfinding.Collections.UnsafeSpan`1[UnityEngine.TreeInstance]& treeInstances, Unity.Mathematics.float3& terrainPos, Unity.Mathematics.float3& terrainSize, Pathfinding.Collections.UnsafeSpan`1[Pathfinding.Graphs.Navmesh.RecastMeshGatherer+TreeInfo]& treeInfos, Unity.Collections.LowLevel.Unsafe.UnsafeList`1[Pathfinding.Graphs.Navmesh.RecastMeshGatherer+GatheredMesh]& allSubmeshes, UnityEngine.Bounds& graphBounds, Unity.Collections.LowLevel.Unsafe.UnsafeList`1[Pathfinding.Graphs.Navmesh.RecastMeshGatherer+GatheredMesh]& meshes) [0x0000f] in <ce47e574011f4248a2ea7d1e748188a4>:0 
  at Pathfinding.Graphs.Navmesh.RecastMeshGatherer.ConvertTreesToMeshes (Pathfinding.Collections.UnsafeSpan`1[UnityEngine.TreeInstance]& treeInstances, Unity.Mathematics.float3& terrainPos, Unity.Mathematics.float3& terrainSize, Pathfinding.Collections.UnsafeSpan`1[Pathfinding.Graphs.Navmesh.RecastMeshGatherer+TreeInfo]& treeInfos, Unity.Collections.LowLevel.Unsafe.UnsafeList`1[Pathfinding.Graphs.Navmesh.RecastMeshGatherer+GatheredMesh]& allSubmeshes, UnityEngine.Bounds& graphBounds, Unity.Collections.LowLevel.Unsafe.UnsafeList`1[Pathfinding.Graphs.Navmesh.RecastMeshGatherer+GatheredMesh]& meshes) <0x1fad41c5690 + 0x00092> in <ce47e574011f4248a2ea7d1e748188a4>:0 
  at Pathfinding.Graphs.Navmesh.RecastMeshGatherer.CollectTreeMeshes (UnityEngine.Terrain terrain) [0x002e0] in .\Library\PackageCache\com.arongranberg.astar\Graphs\Navmesh\RecastMeshGatherer.cs:1058 
  at Pathfinding.Graphs.Navmesh.RecastMeshGatherer.CollectTerrainMeshes (System.Boolean rasterizeTrees, System.Single desiredChunkSize) [0x00063] in .\Library\PackageCache\com.arongranberg.astar\Graphs\Navmesh\RecastMeshGatherer.cs:616 
  at Pathfinding.Graphs.Navmesh.TileBuilder.CollectMeshes (UnityEngine.Bounds bounds) [0x0015d] in .\Library\PackageCache\com.arongranberg.astar\Graphs\Navmesh\TileBuilder.cs:144 
  at Pathfinding.Graphs.Navmesh.TileBuilder.Schedule (Pathfinding.Jobs.DisposeArena arena) [0x00077] in .\Library\PackageCache\com.arongranberg.astar\Graphs\Navmesh\TileBuilder.cs:247 
  at Pathfinding.RecastGraph+RecastGraphScanPromise+<Prepare>d__9.MoveNext () [0x00122] in .\Library\PackageCache\com.arongranberg.astar\Graphs\RecastGraph.cs:1166 
  at Pathfinding.GraphUpdateProcessor.PrepareGraphUpdatePromises (System.Collections.Generic.List`1[T] promises, Pathfinding.Jobs.TimeSlice timeSlice) [0x0010f] in .\Library\PackageCache\com.arongranberg.astar\Core\Pathfinding\GraphUpdateProcessor.cs:244 
  at AstarPath+<ScanInternal>d__133.MoveNext () [0x004c5] in .\Library\PackageCache\com.arongranberg.astar\Core\AstarPath.cs:1836 
  at AstarPath+<TickAsyncScanUntilCompletion>d__130.MoveNext () [0x00060] in .\Library\PackageCache\com.arongranberg.astar\Core\AstarPath.cs:1700 
  at Pathfinding.AstarPathEditor.MenuScan () [0x0008e] in .\Library\PackageCache\com.arongranberg.astar\Editor\AstarPathEditor.cs:1292 

If you think this is a bug, please contact me on forum.arongranberg.com (post a new thread)

UnityEngine.Debug:LogError (object)
Pathfinding.AstarPathEditor:MenuScan () (at ./Library/PackageCache/com.arongranberg.astar/Editor/AstarPathEditor.cs:1305)
Pathfinding.AstarPathEditor/<>c__DisplayClass74_0:<RunTask>b__0 () (at ./Library/PackageCache/com.arongranberg.astar/Editor/AstarPathEditor.cs:788)
UnityEditor.EditorApplication:Internal_CallUpdateFunctions ()

I think it will be the bug inside the Pathfinding project, but if there is anything I should check on my side, please let me know. Thanks! :slight_smile:

Hi

Thank you. Are you able to replicate this error consistently?
Do you think you can turn off burst compilation and see what error you get then?

Hello,

I am able to replicate it with 100% consistency.
Here is the error:

There was an error generating the graphs:
System.IndexOutOfRangeException: Index 8 is out of range in container of '0' Length.
  at Unity.Collections.CollectionHelper.CheckIndexInRange (System.Int32 index, System.Int32 length) [0x0000c] in .\Library\PackageCache\com.unity.collections\Unity.Collections\CollectionHelper.cs:279 
  at Unity.Collections.LowLevel.Unsafe.UnsafeList`1[T].get_Item (System.Int32 index) [0x00001] in .\Library\PackageCache\com.unity.collections\Unity.Collections\UnsafeList.cs:128 
  at Pathfinding.Graphs.Navmesh.RecastMeshGatherer.ConvertTreesToMeshes$BurstManaged (Pathfinding.Collections.UnsafeSpan`1[UnityEngine.TreeInstance]& treeInstances, Unity.Mathematics.float3& terrainPos, Unity.Mathematics.float3& terrainSize, Pathfinding.Collections.UnsafeSpan`1[Pathfinding.Graphs.Navmesh.RecastMeshGatherer+TreeInfo]& treeInfos, Unity.Collections.LowLevel.Unsafe.UnsafeList`1[Pathfinding.Graphs.Navmesh.RecastMeshGatherer+GatheredMesh]& allSubmeshes, UnityEngine.Bounds& graphBounds, Unity.Collections.LowLevel.Unsafe.UnsafeList`1[Pathfinding.Graphs.Navmesh.RecastMeshGatherer+GatheredMesh]& meshes) [0x000d1] in .\Library\PackageCache\com.arongranberg.astar\Graphs\Navmesh\RecastMeshGatherer.cs:1093 
  at Pathfinding.Graphs.Navmesh.RecastMeshGatherer+ConvertTreesToMeshes_00000B93$BurstDirectCall.Invoke (Pathfinding.Collections.UnsafeSpan`1[UnityEngine.TreeInstance]& treeInstances, Unity.Mathematics.float3& terrainPos, Unity.Mathematics.float3& terrainSize, Pathfinding.Collections.UnsafeSpan`1[Pathfinding.Graphs.Navmesh.RecastMeshGatherer+TreeInfo]& treeInfos, Unity.Collections.LowLevel.Unsafe.UnsafeList`1[Pathfinding.Graphs.Navmesh.RecastMeshGatherer+GatheredMesh]& allSubmeshes, UnityEngine.Bounds& graphBounds, Unity.Collections.LowLevel.Unsafe.UnsafeList`1[Pathfinding.Graphs.Navmesh.RecastMeshGatherer+GatheredMesh]& meshes) [0x0000f] in <ce47e574011f4248a2ea7d1e748188a4>:0 
  at Pathfinding.Graphs.Navmesh.RecastMeshGatherer.ConvertTreesToMeshes (Pathfinding.Collections.UnsafeSpan`1[UnityEngine.TreeInstance]& treeInstances, Unity.Mathematics.float3& terrainPos, Unity.Mathematics.float3& terrainSize, Pathfinding.Collections.UnsafeSpan`1[Pathfinding.Graphs.Navmesh.RecastMeshGatherer+TreeInfo]& treeInfos, Unity.Collections.LowLevel.Unsafe.UnsafeList`1[Pathfinding.Graphs.Navmesh.RecastMeshGatherer+GatheredMesh]& allSubmeshes, UnityEngine.Bounds& graphBounds, Unity.Collections.LowLevel.Unsafe.UnsafeList`1[Pathfinding.Graphs.Navmesh.RecastMeshGatherer+GatheredMesh]& meshes) <0x1d7bde1bc60 + 0x00092> in <ce47e574011f4248a2ea7d1e748188a4>:0 
  at Pathfinding.Graphs.Navmesh.RecastMeshGatherer.CollectTreeMeshes (UnityEngine.Terrain terrain) [0x002e0] in .\Library\PackageCache\com.arongranberg.astar\Graphs\Navmesh\RecastMeshGatherer.cs:1058 
  at Pathfinding.Graphs.Navmesh.RecastMeshGatherer.CollectTerrainMeshes (System.Boolean rasterizeTrees, System.Single desiredChunkSize) [0x00063] in .\Library\PackageCache\com.arongranberg.astar\Graphs\Navmesh\RecastMeshGatherer.cs:616 
  at Pathfinding.Graphs.Navmesh.TileBuilder.CollectMeshes (UnityEngine.Bounds bounds) [0x0015d] in .\Library\PackageCache\com.arongranberg.astar\Graphs\Navmesh\TileBuilder.cs:144 
  at Pathfinding.Graphs.Navmesh.TileBuilder.Schedule (Pathfinding.Jobs.DisposeArena arena) [0x00077] in .\Library\PackageCache\com.arongranberg.astar\Graphs\Navmesh\TileBuilder.cs:247 
  at Pathfinding.RecastGraph+RecastGraphScanPromise+<Prepare>d__9.MoveNext () [0x00122] in .\Library\PackageCache\com.arongranberg.astar\Graphs\RecastGraph.cs:1166 
  at Pathfinding.GraphUpdateProcessor.PrepareGraphUpdatePromises (System.Collections.Generic.List`1[T] promises, Pathfinding.Jobs.TimeSlice timeSlice) [0x0010f] in .\Library\PackageCache\com.arongranberg.astar\Core\Pathfinding\GraphUpdateProcessor.cs:244 
  at AstarPath+<ScanInternal>d__133.MoveNext () [0x004c5] in .\Library\PackageCache\com.arongranberg.astar\Core\AstarPath.cs:1836 
  at AstarPath+<TickAsyncScanUntilCompletion>d__130.MoveNext () [0x00060] in .\Library\PackageCache\com.arongranberg.astar\Core\AstarPath.cs:1700 
  at Pathfinding.AstarPathEditor.MenuScan () [0x0008e] in .\Library\PackageCache\com.arongranberg.astar\Editor\AstarPathEditor.cs:1292 

If you think this is a bug, please contact me on forum.arongranberg.com (post a new thread)

UnityEngine.Debug:LogError (object)
Pathfinding.AstarPathEditor:MenuScan () (at ./Library/PackageCache/com.arongranberg.astar/Editor/AstarPathEditor.cs:1305)
Pathfinding.AstarPathEditor/<>c__DisplayClass74_0:<RunTask>b__0 () (at ./Library/PackageCache/com.arongranberg.astar/Editor/AstarPathEditor.cs:788)
UnityEditor.EditorApplication:Internal_CallUpdateFunctions ()

And the second one:

IndexOutOfRangeException: Index 8 is out of range in container of '0' Length.
Pathfinding.AstarPathEditor.MenuScan () (at ./Library/PackageCache/com.arongranberg.astar/Editor/AstarPathEditor.cs:1307)
Pathfinding.AstarPathEditor+<>c__DisplayClass74_0.<RunTask>b__0 () (at ./Library/PackageCache/com.arongranberg.astar/Editor/AstarPathEditor.cs:788)
UnityEditor.EditorApplication.Internal_CallUpdateFunctions () (at <45b9485b4ba64564b30d91e935218d54>:0)

Hi

Is any prefab of your terrain’s Paint Trees tab missing by any chance?

Hello,
I made a little bit more investigation and I was able to reproduce it on small example.

Repro steps:

  1. Create two terrains objects in the scene
  2. Create one tree prefab. (Capsule for example)
  3. Add the same tree prefab on both terrains.
  4. Use “Mass place trees” on both terrains
  5. Add one Recast graph.

Result:
“Snap bounds to scene” button stops working.
“Scan” button stops working (You can use “Snap bounds to scene” when there is no trees or just manually resize it)

The “Snap bounds to scene” button exception:

IndexOutOfRangeException: Index 0 is out of range in container of '0' Length.
Unity.Collections.CollectionHelper.CheckIndexInRange (System.Int32 index, System.Int32 length) (at ./Library/PackageCache/com.unity.collections@d49facba0036/Unity.Collections/CollectionHelper.cs:279)
Unity.Collections.LowLevel.Unsafe.UnsafeList`1[T].get_Item (System.Int32 index) (at ./Library/PackageCache/com.unity.collections@d49facba0036/Unity.Collections/UnsafeList.cs:128)
Pathfinding.Graphs.Navmesh.RecastMeshGatherer.ConvertTreesToMeshes$BurstManaged (Pathfinding.Collections.UnsafeSpan`1[UnityEngine.TreeInstance]& treeInstances, Unity.Mathematics.float3& terrainPos, Unity.Mathematics.float3& terrainSize, Pathfinding.Collections.UnsafeSpan`1[Pathfinding.Graphs.Navmesh.RecastMeshGatherer+TreeInfo]& treeInfos, Unity.Collections.LowLevel.Unsafe.UnsafeList`1[Pathfinding.Graphs.Navmesh.RecastMeshGatherer+GatheredMesh]& allSubmeshes, UnityEngine.Bounds& graphBounds, Unity.Collections.LowLevel.Unsafe.UnsafeList`1[Pathfinding.Graphs.Navmesh.RecastMeshGatherer+GatheredMesh]& meshes) (at ./Library/PackageCache/com.arongranberg.astar@d8e3782393c9/Graphs/Navmesh/RecastMeshGatherer.cs:1093)
Pathfinding.Graphs.Navmesh.RecastMeshGatherer+ConvertTreesToMeshes_00000B23$BurstDirectCall.Invoke (Pathfinding.Collections.UnsafeSpan`1[UnityEngine.TreeInstance]& treeInstances, Unity.Mathematics.float3& terrainPos, Unity.Mathematics.float3& terrainSize, Pathfinding.Collections.UnsafeSpan`1[Pathfinding.Graphs.Navmesh.RecastMeshGatherer+TreeInfo]& treeInfos, Unity.Collections.LowLevel.Unsafe.UnsafeList`1[Pathfinding.Graphs.Navmesh.RecastMeshGatherer+GatheredMesh]& allSubmeshes, UnityEngine.Bounds& graphBounds, Unity.Collections.LowLevel.Unsafe.UnsafeList`1[Pathfinding.Graphs.Navmesh.RecastMeshGatherer+GatheredMesh]& meshes) (at <e2e1a35c02a741368174fef8dcc6140d>:0)
Pathfinding.Graphs.Navmesh.RecastMeshGatherer.ConvertTreesToMeshes (Pathfinding.Collections.UnsafeSpan`1[UnityEngine.TreeInstance]& treeInstances, Unity.Mathematics.float3& terrainPos, Unity.Mathematics.float3& terrainSize, Pathfinding.Collections.UnsafeSpan`1[Pathfinding.Graphs.Navmesh.RecastMeshGatherer+TreeInfo]& treeInfos, Unity.Collections.LowLevel.Unsafe.UnsafeList`1[Pathfinding.Graphs.Navmesh.RecastMeshGatherer+GatheredMesh]& allSubmeshes, UnityEngine.Bounds& graphBounds, Unity.Collections.LowLevel.Unsafe.UnsafeList`1[Pathfinding.Graphs.Navmesh.RecastMeshGatherer+GatheredMesh]& meshes) <0x2ac115ee8f0 + 0x00092> in <e2e1a35c02a741368174fef8dcc6140d>:0
Pathfinding.Graphs.Navmesh.RecastMeshGatherer.CollectTreeMeshes (UnityEngine.Terrain terrain) (at ./Library/PackageCache/com.arongranberg.astar@d8e3782393c9/Graphs/Navmesh/RecastMeshGatherer.cs:1058)
Pathfinding.Graphs.Navmesh.RecastMeshGatherer.CollectTerrainMeshes (System.Boolean rasterizeTrees, System.Single desiredChunkSize) (at ./Library/PackageCache/com.arongranberg.astar@d8e3782393c9/Graphs/Navmesh/RecastMeshGatherer.cs:616)
Pathfinding.Graphs.Navmesh.TileBuilder.CollectMeshes (UnityEngine.Bounds bounds) (at ./Library/PackageCache/com.arongranberg.astar@d8e3782393c9/Graphs/Navmesh/TileBuilder.cs:144)
Pathfinding.RecastGraph.SnapBoundsToScene () (at ./Library/PackageCache/com.arongranberg.astar@d8e3782393c9/Graphs/RecastGraph.cs:943)
Pathfinding.RecastGraphEditor.OnInspectorGUI (Pathfinding.NavGraph target) (at ./Library/PackageCache/com.arongranberg.astar@d8e3782393c9/Editor/GraphEditors/RecastGraphEditor.cs:283)
Pathfinding.AstarPathEditor.DrawGraph (Pathfinding.GraphEditor graphEditor) (at ./Library/PackageCache/com.arongranberg.astar@d8e3782393c9/Editor/AstarPathEditor.cs:557)
Pathfinding.AstarPathEditor.DrawMainArea () (at ./Library/PackageCache/com.arongranberg.astar@d8e3782393c9/Editor/AstarPathEditor.cs:286)
Pathfinding.AstarPathEditor.OnInspectorGUI () (at ./Library/PackageCache/com.arongranberg.astar@d8e3782393c9/Editor/AstarPathEditor.cs:201)
UnityEditor.UIElements.InspectorElement+<>c__DisplayClass81_0.<CreateInspectorElementUsingIMGUI>b__0 () (at <7b2c278a0842479495d69e0e654c49ab>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)
1 Like

Thanks!

I managed to replicate the issue and I’ll include a fix in the next beta update.