Hi,
I have seen a few threads like this but have yet to determine if this is the way A* works or if there is a way around this issue. I am using Beta.
If I go down the route of re-scanning my graphs (recast), this happens:
I am controlling my character (running), and within my run a NPC comes into my graph area (250x250), so I scan my in order to use A*. The issue is that my character lags for a split second while the graph is scanned, it might just be 80-120ms spike, but its very noticeable within gameplay. As far as I have read, threads will not help as the scan is done on unity’s main thread, correct?
If yes, is there a way around this and still use a scan in my situation?
I am using the following rescan code that I have found in your documentation:
IEnumerator UpdateGraphCoroutine ()
{
foreach (Progress progress in AstarPath.active.ScanAsync()) {
//Debug.Log("Scanning... " + progress.description + " - " + (progress.progress*100).ToString("0") + "%");
yield return null;
}
}
I also not determine that following by reading the documentation, can you please answer:
- Can you use GraphUpdateScene for recasts?
- Does recasttileupdate, recasttileupdatehandler and GraphUpdateScene just update current scanned graph? Or can you use these to add to an existing graph?
Thanks.