[Solved] Error Generating Graphs after scan [Navmesh][2018.3]

Recently updated to 4.2 (free version) since I’m using the unity beta (Currently 2018.3.0b6)

Any scanning of navmesh gets a null reference exception in ScanInternal.MoveNext

[spoiler]There was an error generating the graphs:
System.NullReferenceException: Object reference not set to an instance of an object
at Pathfinding.NavMeshGraph+d__20.MoveNext () [0x002b2] in …\Assets\AstarPathfindingProject\Generators\NavMeshGenerator.cs:248
at AstarPath+d__143.MoveNext () [0x0016a] in …\Assets\AstarPathfindingProject\Core\AstarPath.cs:1799
at AstarPath+d__142.MoveNext () [0x0031f] in …\Assets\AstarPathfindingProject\Core\AstarPath.cs:1736
at Pathfinding.AstarPathEditor.MenuScan () [0x000e9] in …\Assets\AstarPathfindingProject\Editor\AstarPathEditor.cs:1322

If you think this is a bug, please contact me on forum.arongranberg.com (post a new thread)

UnityEngine.Debug:LogError(Object)
Pathfinding.AstarPathEditor:MenuScan() (at Assets/AstarPathfindingProject/Editor/AstarPathEditor.cs:1331)
Pathfinding.AstarPathEditor:OnInspectorGUI() (at Assets/AstarPathfindingProject/Editor/AstarPathEditor.cs:260)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
[/spoiler]

It seems to occur because navmeshUpdateData is null when navmeshUpdateData.OnRecalculatedTiles(tiles) is called in NavMeshGraph.ScanInternal of NavMeshGenerator.cs
With that line commented out, the scan completes without an error (but presumably would cause issues for larger/cut navmeshes)

Happens even on an empty project with just astar added and using the example navmesh.

Oops. That was indeed a bug. Some initialization code had been marked as pro only by mistake.
I am uploading version 4.2.1 which fixes this bug right now (it will be uploaded in a few minutes): https://www.arongranberg.com/astar/download

Confirmed it’s now working on 4.2.1 - thanks for the amazingly fast update!

1 Like