Error message, from navmesh update

im not using a navmesh(using point graph) so it makes sense that it cannot be found, but it seems out of place that this script would be running at all.
the error will delete my current graph. its not a common problem probably has only happened to me twice, figured id bring it to your attention.

NullReferenceException: Object reference not set to an instance of an object
Pathfinding.NavmeshUpdates.Update () (at Assets/AstarPathfindingProject/Navmesh/NavmeshUpdates.cs:167)
AstarPath.Update () (at Assets/AstarPathfindingProject/Core/AstarPath.cs:862)

Hi

Do you think you could post the exact line which seems to throw the exception?
Does this happen in play mode or outside of play mode? Is it immediately when you start the game or does it happen after a while? Does it happen multiple times or just once?

the error occurred while in playmode, completely at random. not while scanning or making a path. im unaware of the exact line . i assumed it would of been included in the error message. - i vaguely recall it was/or very close to the top line of the navmesh update() function.
the error is thrown only once, after getting the error i checked the pathfinding component to see if there really was a navmesh . the default graph on the script was removed(i dont have any script that destroys or removes graphs) (after pressing stop the the point graph returned), , the message was followed by a dump of “missing script cannot be found” warnings , i can not recall if this occurred previous time

Hi

Are you sure it wasn’t a case of Unity recompiling the scripts during runtime? If you change some script in an external editor during play mode, unity will try to recompile them and reload them. For most complex scripts the reloading doesn’t really work however as Unity’s serialization system is not good enough to handle the data, so things have a tendency to break. I believe you can turn off this automatic recompilation in the Unity settings.

that is probably the cause, i think i was editing a script and forgot to exit playmode(i didn’t know this happened , but useful to know why i sometimes get those missing script errors… i didnt know how i was supposed to track down missing scripts XD)
i would of figured it to just be a crash within unity but the fact it happened at navsmesh update made me wonder why that would of been running in the first place.

1 Like