- A* version: [5.3.7pro]
- Unity version: [2022.3.52f1]
Hello,
Love the product - have a question about ScanAsync regarding a small framerate hitch - tried searching the forums and didn’t see anything on this, so if there are already solves to it posted, please point me that direction.
My playable area is very large so I just started using the ScanAsync so I could update the grids on the fly - centered near the player. Right now updating as the player gets about halfway from the center to the edge of the grid.
I’m still working out if this is the best way to handle a large playable area or to try to encompass a much larger area to do the updates less frequently.
I am using two overlapping grids (for different AI types) that are 500 by 500 with a 25 unit node distance.
When I do the ScanAsync , I am getting the tiniest of hitches at the end of the sync. Happens on PC and iOS.
I tried doing the syncs for both on the same call. I tried doing them sequentially as well. I also just tried only updating one to see if it was the two grids causing the issue.
Is this the expected behavior?
EDIT: as I am still in the initial stages of working this out, there is a chance that I have triggered a new scanasync prior to the last one finishing sometimes - not sure if that would change things.
Thanks!
Code being implemented in the ScanAsync:
At the call:
print(“ASYNC SCAN OF ASTARS … starting…”);
StartCoroutine(ASyncGridScans());
Then:
IEnumerator ASyncGridScans() {
foreach (Progress progress in AstarPath.active.ScanAsync()) {
//Debug.Log("Scanning… " + progress.ToString());
yield return null;
}
print(“ASYNC SCAN OF ASTARS… COMPLETE!”);
}