Node2link after RelocateAllNodes

Hello.

Im currently debugging an issue with asynchronously loading gridgraphs.

Our demands are that we load each scene asynch and then offset it to “connect” it to current levels.
This is done in random order so the offsets will differ, currently we only move along Z axis but we have support for moving in X aswell.

Before deciding to replace unitys navemesh component system and use Astar instead(mostly for tags and easier live manipulation of paths and walkable zones) I tested everything we needed in a test scene, and I could there properly DeserializeGraphsAdditive() (after loading them from saved unitytextassets) then from astar.data use RelocateNodes(). The seeker would then properly identify the Nodelink2 link for pathfinding. When testing this in live enviroment, we noticed frame drops, so we implemented them in unity Jobs. framework with succes, however. In the live enviroment, seeker wont detect the link.

Iw tried assiging the end link both before and after calling RelocateNodes, and I get no error messages. Im unsure where to continue debugging at this point, because seeker just wont detect the paths, and the same method calls works fine in the testscene.

Issue was this check:
if (Application.isPlaying && AstarPath.active != null && AstarPath.active.data != null && AstarPath.active.data.pointGraph != null && !AstarPath.active.isScanning)
Specifically pointGraph != null part. Since all I had loaded in was gridGraphs.

So commenting it out, loading everything scanned with disabled links and enabling it after moving it and changing the if checks to:

        if (Application.isPlaying && AstarPath.active != null && AstarPath.active.data != null && !AstarPath.active.isScanning)

fixed the issue.

1 Like