Support Forum

Graph doesn't initialize/load at runtime

When I enter into playmode, I get an error when I first try to assign the grid graph to a variable by graph name, stating that “” is null. The “Graphs” section of the Pathfinder component is empy, the graph that was there in edit mode does not appear.

But if I select the GameObject in the inspector that contains the pathfinder component prior to entering paymode, everything works fine. I have tried cache and non-cache saves of the graph, manual graph scanning vs scan on awake, modifying the script execution order, but nothing seems to fix this.

Any ideas what might be going on here?


Are you using the experimental enter play mode settings that unity has?

Well that would make sense. Forgot about that, thanks.

This mode is better supported in the beta.