Sample4Tile error [Solved-ish]


[Edit: Deleted MapNav and reinstalled and the error was gone]

I’m not sure why this is happening, but I’m getting this error when clicking any tile.

NullReferenceException: Object reference not set to an instance of an object
Sample4Controller.Update ()

which is pointing to this line:
Sample4Tile n = map.NodeAtWorldPosition(hit.point);

When using Debug it’s clicking the correct tile, however it’s like the Sample4Tile isn’t present. I’ve even tried re-generating a new grid.

I’m curious if anyone has encountered this before and what they did?


(Leslie Young) #2

This is the preferred way to report console messages. When Reporting Errors

Sample4Controller.cs uses the generic version of NodeAtWorldPosition so if you are not using that then you have an old version of MapNav2. Have a look at the link I posted above as it include some info on how you can try force a clean download of MapNav from the asset store to get the correct version.

Well, assuming you did not quote this incorrectly
Sample4Tile n = map.NodeAtWorldPosition(hit.point);