Upgrading from free to Pro breaks my project


I have been using the free version (4.2.15) of A* Pathfinding Project for the last few months. Now I have bought the Pro version. Unfortunately trying to upgrade to it breaks my project – and I have no idea why.

Once I import A* Pathfinding Project Pro, I am getting NullReferenceException errors:

The first one is from where I want to access my grid this way:

this.gridGraph = AstarPath.active.data.FindGraph(g => g.name == "RoadBuildingGridGraph") as GridGraph;

A GridGraph with that name does exist and has worked flawlessly with the free version.

The second one is Pathfinding’s own IsPathPossible (which makes sense as there doesn’t seem to be something to access now in the first place).

To upgrade I both tried deleting the free version from the project and importing the pro one as well as just overwriting it.
My Unity version is 2019.4.16f1. I tried updating to the most recent version for 2019, but that didn’t change anything.

I have no idea what went wrong as everything worked before and now magically doesn’t. :confused:
Did I make any mistakes the way I upgraded? Or does the Pro version work in a different way than the free one?

You are running your manager during Awake, that’s also the time when the pathfinding graphs are loaded and initialized. The order in which Awake calls run is unspecified in Unity unless you explicitly define it. Maybe when you re-imported the package Unity assigned a different order and now your manager runs before the A* scripts.
I’d recommend running the manager in Start instead, or alternatively assigning a priority for it in Unity’s execution order settings.

1 Like

That’s the problem – thank you so much! This has been buggin me for over a day now.
I completely forgot that I tinkered with the execution order to make it fit my needs after not being able to work on my project for three months. :sweat_smile:

Thanks a lot for your help!

1 Like