I’m using a script to scan 4 graphs at runtime. It weirdly takes 4-5 mins to load it through the script, compared to about 10-15 seconds using the ‘scan’ button in the editor.
Note: when I press the menu scan while it’s already scanning, it takes 4-5 mins to load too. It only takes 10 secs if I press menu scan before any kind of runtime scanning takes place. I use AstarPath.active.Scan();
It only scans it once through a single invoke function and I’m just flabbergasted at how this could be happening. Please help? Thank you
What exact code are you using to scan the graph?
Also, do you mean a difference between play mode and edit mode or one between the editor and a standalone player?
I just use
AstarPath.active.Scan();
And I mean the difference between play mode and editor mode, like while I’m working on the game in the Unity editor.
There is just such a marked difference in speed between my runtime scan using that code and when I just press ‘scan’ in the editor (menuscan). I also see it freezing for a while on something like ‘Assigning graph to indices’.
As for the scene, I have about 100 trees with capsule colliders, spread out on 16 tiles (4x4) of 30x30 size. Here are my settings for my graphs (4 of them)
That is very strange. It definitely shouldn’t take more than 10 seconds. In a test scene scanning a similarly sized graph takes about 900 ms (though my scene is probably simpler than yours).
Which version of the package are you using?
And again. Please post the exact code (including context) you are using to scan the graphs.
Above is the exact code I’ve been trying to use. This script is in my title scene, it doesn’t get destroyed upon scene change and it controls things like the loading screen, and triggering terrain and map object generation upon loading the game scene.
One thing I did notice is that, once Astarpath.active.scan() is already working, if I press the menu scan it also takes a long time to load (about 1 minute per graph x 4)
Let me check right now. And thank you so much for taking the time looking at this, I’m going insane cause I remember it loading a lot faster before I started using multiple, smaller terrains instead of just one big one