How to determine if there are any pending graph updates?

Upon game load, there are a bunch of GraphUpdateObjects which trigger to update the grid graph to apply proper tagging, penalties, etc. to account for doors, walls, etc.

I need a way to know when those updates are done, so I can then begin the game. Currently they seem to be async and I can’t find a way to essentially wait until they’re all applied and completed.

Thank you

You may want to check out AstarPath.isScanning :smiley: Seems like exactly what you’re looking for.

Just for knowledge’s sake, there’s also IsAnyGraphUpdateInProgress, IsAnyGraphUpdateQueued, and IsAnyWorkItemInProgress also a part of AstarPath! These are for graph updates rather than graph scans though.

You can also force them to complete immediately using:

AstarPath.active.FlushGraphUpdates();
1 Like