This might not be fixable but I am throwing it out there.
All my maps are build with the Probuilder asset and while the graph builds in the editor works it fails in a standalone build.
I have a work around, if I cache the graph it works in standalone builds and also testing if delaying the scan to after the level has loaded to see if that works as well.
Hi
That’s odd.
What platform are you using?
Are you getting any errors?
Is the level already in the scene when the scene is loaded or is it being generated? If it is being generated it might be that it is generated after the graph has been calculated. In that case you might want to call
AstarPath.active.Scan()
After the level has been generated.
I get this repeated in the output log from a windows build:
(Filename: C:/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 37)
Collecting Meshes
Some meshes were statically batched. These meshes can not be used for navmesh calculation due to technical constraints.
During runtime scripts cannot access the data of meshes which have been statically batched.
One way to solve this problem is to use cached startup (Save & Load tab in the inspector) to only calculate the graph when the game is not playing.
I haven’t tried the AstraPath.active.Scan() yet but I will give it a go once I work out the best place to call it.
I tried AstraPath.active.Scan() before the map data got hidden for rendering and now it no longer works in the editor and get the same error in the output_log.txt
It is related to the probuilder asset just not sure why it works fine in the editor if I use a normal Recast vs Stand alone build.
Hi
So it seems that pro builder will statically batch the meshes in standalone build.
When meshes are statically batched, my scripts cannot access their data unfortunately, so they cannot generate a navmesh from them. You could either try to find out when pro builder statically batches the data and make sure the navmesh is generated before that, or you could use colliders instead for navmesh generation (uncheck the ‘Rasterize Meshes’ toggle and check the ‘Rasterize Colliders’ toggle).
Or you could do what the error message hints about, to use cached startup.
I am caching at the moment which does work fine but I will see if I can get the mesh running before pro-builder.
Thanks for your insight.