Only sometimes, I get a warning message which destroys my game’s playability. The warning message is following:
The Grid Graph is not scanned, cannot update area
UnityEngine.Debug:LogWarning (object)
Pathfinding.GridGraph:Pathfinding.IUpdatableGraph.UpdateArea (Pathfinding.GraphUpdateObject) (at Library/PackageCache/com.arongranberg.astar@4.3.49/Generators/GridGenerator.cs:2996)
Pathfinding.GraphUpdateProcessor:ProcessRegularUpdates (bool) (at Library/PackageCache/com.arongranberg.astar@4.3.49/Core/Misc/GraphUpdateProcessor.cs:277)
Pathfinding.GraphUpdateProcessor:ProcessGraphUpdates (Pathfinding.IWorkItemContext,bool) (at Library/PackageCache/com.arongranberg.astar@4.3.49/Core/Misc/GraphUpdateProcessor.cs:193)
Pathfinding.WorkItemProcessor:ProcessWorkItems (bool,bool) (at Library/PackageCache/com.arongranberg.astar@4.3.49/Core/Misc/WorkItemProcessor.cs:301)
Pathfinding.WorkItemProcessor:ProcessWorkItemsForUpdate (bool) (at Library/PackageCache/com.arongranberg.astar@4.3.49/Core/Misc/WorkItemProcessor.cs:381)
AstarPath:PerformBlockingActions (bool) (at Library/PackageCache/com.arongranberg.astar@4.3.49/Core/AstarPath.cs:884)
AstarPath:Update () (at Library/PackageCache/com.arongranberg.astar@4.3.49/Core/AstarPath.cs:867)
and sometimes following:
The Grid Graph is not scanned, cannot update area
UnityEngine.Debug:LogWarning (object)
Pathfinding.GridGraph:Pathfinding.IUpdatableGraph.UpdateArea (Pathfinding.GraphUpdateObject) (at Library/PackageCache/com.arongranberg.astar@4.3.49/Generators/GridGenerator.cs:2996)
Pathfinding.GraphUpdateProcessor:ProcessRegularUpdates (bool) (at Library/PackageCache/com.arongranberg.astar@4.3.49/Core/Misc/GraphUpdateProcessor.cs:277)
Pathfinding.GraphUpdateProcessor:ProcessGraphUpdates (Pathfinding.IWorkItemContext,bool) (at Library/PackageCache/com.arongranberg.astar@4.3.49/Core/Misc/GraphUpdateProcessor.cs:193)
Pathfinding.WorkItemProcessor:ProcessWorkItems (bool,bool) (at Library/PackageCache/com.arongranberg.astar@4.3.49/Core/Misc/WorkItemProcessor.cs:301)
Pathfinding.WorkItemProcessor:ProcessWorkItemsForScan (bool) (at Library/PackageCache/com.arongranberg.astar@4.3.49/Core/Misc/WorkItemProcessor.cs:364)
AstarPath/<ScanInternal>d__144:MoveNext () (at Library/PackageCache/com.arongranberg.astar@4.3.49/Core/AstarPath.cs:1824)
AstarPath:Scan (Pathfinding.NavGraph[]) (at Library/PackageCache/com.arongranberg.astar@4.3.49/Core/AstarPath.cs:1660)
PathfinderAwakeScanner:FixedUpdate () (at Assets/Sunpeak Game/PathfinderAwakeScanner.cs:15)
Looks like that specific warning was discussed in the above thread. But I am not (1) using any GraphUpdateScene object in the scenes, (2) serializing/de-serializing the graph data, (3) having any parent-child game object mix-ups that were suggested as solutions in the above mentioned thread.
I’m just calling Astar.active.Scan()
on Awake() on an independent monobehaviour that is in every scene I work with. For past several months, that worked flawlessly. Then, this warning started to happen and I can’t figure out how to make the graph graph scanned before the enemies spawn (which needs the graph to be scanned before they move).
I tried calling Astar.active.Scan()
on Awake(), OnEnable(), Start(), IEnumerator wait 0.5 seconds, but none of that resulted in the grid graph being properly scanned. I tried changing script execution order of the monobehaviour before / after other Pathfinding items.
Only when I press the Scan button on Pathfinder in the inspector manually, it gets Scanned as expected. Is there any way to fix this issue?