I changed my terrain from Unity Terrain to Mesh GameObject and now GridGraph.nodes returns empty after setting up a GridGraph at runtime as usual (adjusting position and dimensions to Mesh GameObject). GridGraph.nodes.Length throws a NullReferenceException error. This single, properly scanned, GridGraph is visible in the scene along with the terrain mesh, pathfinding seems to be carried out normally and GridGraph.width returns values as usual. Does anyone have any idea what may cause this?
Are you sure you haven’t added multiple grid graphs by any chance?
What is your code for setting this up?
Do you get any other errors in the console?
Problem solved! I called Active.data.gridGraph.Scan() only after trying the access the nodes array in my project and left it out in my previous post completely. Calling gridGraph.Scan() populates the nodes array.