In the beta package and on unity 2021 LTS, im using the ProceduralGridMover on my players and whenever the graph gets updated due to distance, i get this “error”, as in more like a warning since it still works:
InvalidOperationException: The previously scheduled job GridGraphScanData:CopyBuffersJob writes to the Unity.Collections.NativeArray`1[UnityEngine.Vector3] CopyBuffersJob.output.nodePositions. You must call JobHandle.Complete() on the job GridGraphScanData:CopyBuffersJob, before you can read from the Unity.Collections.NativeArray`1[UnityEngine.Vector3] safely.
Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle.CheckReadAndThrowNoEarlyOut (Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle handle) (at <e8a406da998549af9a2680936c7da25a>:0)
Unity.Collections.NativeArray`1[T].CheckElementReadAccess (System.Int32 index) (at <e8a406da998549af9a2680936c7da25a>:0)
Unity.Collections.NativeArray`1[T].get_Item (System.Int32 index) (at <e8a406da998549af9a2680936c7da25a>:0)
Mapping.DirectionalBlockGridRule.<Register>b__3_0 (Pathfinding.GridGraphRules+Context context) (at Assets/Scripts/Mapping/AstarRules/DirectionalBlockGridRule.cs:101)
Pathfinding.GridGraphRules.CallActions (System.Collections.Generic.List`1[T] actions, Pathfinding.GridGraphRules+Context context) (at Library/PackageCache/com.arongranberg.astar@4.3.61/Generators/GridGraph/GridGraphRules.cs:118)
UnityEngine.Debug:LogException(Exception)
Pathfinding.GridGraphRules:CallActions(List`1, Context) (at Library/PackageCache/com.arongranberg.astar@4.3.61/Generators/GridGraph/GridGraphRules.cs:120)
Pathfinding.<ExecuteRule>d__13:MoveNext() (at Library/PackageCache/com.arongranberg.astar@4.3.61/Generators/GridGraph/GridGraphRules.cs:131)
Pathfinding.<UpdateAreaBurstCoroutine>d__107:MoveNext() (at Library/PackageCache/com.arongranberg.astar@4.3.61/Generators/GridGenerator.cs:1912)
Pathfinding.Jobs.<CompleteTimeSliced>d__4:MoveNext() (at Library/PackageCache/com.arongranberg.astar@4.3.61/Utilities/JobDependencyTracker.cs:106)
Pathfinding.<UpdateGraphCoroutine>d__15:MoveNext() (at Library/PackageCache/com.arongranberg.astar@4.3.61/Utilities/ProceduralGridMover.cs:312)
Pathfinding.<>c__DisplayClass14_0:<UpdateGraph>b__0(IWorkItemContext, Boolean) (at Library/PackageCache/com.arongranberg.astar@4.3.61/Utilities/ProceduralGridMover.cs:163)
Pathfinding.WorkItemProcessor:ProcessWorkItems(Boolean, Boolean) (at Library/PackageCache/com.arongranberg.astar@4.3.61/Core/Misc/WorkItemProcessor.cs:299)
Pathfinding.WorkItemProcessor:ProcessWorkItemsForUpdate(Boolean) (at Library/PackageCache/com.arongranberg.astar@4.3.61/Core/Misc/WorkItemProcessor.cs:379)
AstarPath:PerformBlockingActions(Boolean) (at Library/PackageCache/com.arongranberg.astar@4.3.61/Core/AstarPath.cs:863)
AstarPath:Update() (at Library/PackageCache/com.arongranberg.astar@4.3.61/Core/AstarPath.cs:846)
I also have a question about grid movers: would you be able to use it on multiple players, lets say up to 100+ without many hitches? I was originally caching the entire graph but it took too much memory for my crappy server to even start. Sort of a rock and a hard place situation where i would like it cached without taking up too much memory and would like it dynamic with moving players without using too much processing power
EDIT: actually just tried this, doesnt seem to work with 2 players at the same time with the server controlling it, i wonder if theres a dynamic way to just get an AB path without caching? or if its even worth doing