Cannot add more than 1 NavMeshGraph and perform scan

There was an error generating the graphs:
System.IndexOutOfRangeException: Array index is out of range.
at Pathfinding.NavMeshGraph.GetVertex (Int32 index) [0x00000] in C:\Users\giles.park\DAWorkspace\da_project1\MainBranches\Trunk\UnityProject\Assets\AstarPathfindingProject\Generators\avMeshGenerator.cs:88
at Pathfinding.TriangleMeshNode.UpdatePositionFromVertices () [0x0000c] in C:\Users\giles.park\DAWorkspace\da_project1\MainBranches\Trunk\UnityProject\Assets\AstarPathfindingProject\Generators\odeClasses\TriangleMeshNode.cs:37
at Pathfinding.NavMeshGraph.GenerateNodes (UnityEngine.Vector3[] vectorVertices, System.Int32[] triangles, UnityEngine.Vector3[]& originalVertices, Pathfinding.Int3[]& vertices) [0x00378] in C:\Users\giles.park\DAWorkspace\da_project1\MainBranches\Trunk\UnityProject\Assets\AstarPathfindingProject\Generators\avMeshGenerator.cs:640
at Pathfinding.NavMeshGraph.ScanInternal (.OnScanStatus statusCallback) [0x0004c] in C:\Users\giles.park\DAWorkspace\da_project1\MainBranches\Trunk\UnityProject\Assets\AstarPathfindingProject\Generators\avMeshGenerator.cs:526
at AstarPath.ScanLoop (.OnScanStatus statusCallback) [0x00326] in C:\Users\giles.park\DAWorkspace\da_project1\MainBranches\Trunk\UnityProject\Assets\AstarPathfindingProject\Core\AstarPath.cs:1762
at AstarPathEditor.MenuScan () [0x000c1] in C:\Users\giles.park\DAWorkspace\da_project1\MainBranches\Trunk\UnityProject\Assets\AstarPathfindingProject\Editor\AstarPathEditor.cs:2320

Hm…
Is there a possibility that you could create a small example project which throws that exception and send it to me?

Can do, just send you it via email(which is ?) or can I do it via this forum.

I don’t want to post my email here (spam problems).
But there are lots of free file upload services, do you think you could upload it to one of them?

Microsoft SkyDrive link, hope that works

https://onedrive.live.com/redir?resid=17E2D6C42E498484!107&authkey=!AGySzbJXFnKUuu0&ithint=file%2C.unitypackage

I’ve managed to fix this.

When generating the nodes for the second mesh (in NavMeshGenerator.GenerateNodes), the GraphIndex for the TriangleMeshNodes was defaulting to 0.

Fixed by setting the GraphIndex, Line 610 of NavMeshGenerator.GenerateNodes:

		int graphIndex = active.astarData.GetGraphIndex(this);  // ADDED
		for (int i=0;i<nodes.Length;i++) {
			
			nodes[i] = new TriangleMeshNode(active);
			TriangleMeshNode node = nodes[i];//new MeshNode ();

			node.GraphIndex = (uint)graphIndex;

Thanks!
Awesome that you managed to fix it yourself!

Sorry for not getting back to you earlier, I am currently away on other business and can unfortunately not spend much time on the A* Pathfinding Project for a few weeks.

This fix will be included in the next patch.