"The NativeReference is already disposed" error on AstarPath

For some reason I keep getting “ObjectDisposedException: Cannot access a disposed object.
Object name: ‘The NativeReference is already disposed.’.” on my A* game object.
The object has nothing beside the AstarPath script, and there are no objects actually using the pathfinding on scene.

My settings are as so:

  • A* version: 5.3.6
  • Unity version: 2022.3.62f1

Hi

Try upgrading your version of the unity collections package to a more recent version. That will resolve the issue.

I have the same problem while using 2D Grid graph. But the collections package is already latest.
my unity version is 2022.3.55f1 with collection package of 1.5.1
the a star project is 5.3.7

is there any other workaround?

Can you post the full stack trace?
I see this has been addressed in your other thread.

1 Like