Graphs not in build 2018.2.19f1

Hey,
So I’ve noticed something recently. I’m on version 4.2.4 of the package inside unity 2018.2.19f1

In the editor, everything works fine - I am able to run the game and the grid that I have stored inside the A* object loads no problem
However, when I create a build, it’s like the grid disappears - doing a count at runtime shows Astar.current.grids.Length as 1 inside the editor, and 0 in builds. Any idea what could be causing that?

I’ve gone as far as completely deleting the object from my scene and recreating it, but still no dice

This happened on 4.2.2 as well, it didn’t use to happen so I’m assuming either a unity issue in the new version caused it or something changed between this version of A* pathfinding and an older one

Hi

Do you see any error messages in the player log?

I hadn’t even thought to look, looking at the output log when the scene is loaded I see this error:

ReflectionTypeLoadException: The classes in the module cannot be loaded.
at (wrapper managed-to-native) System.Reflection.Assembly:GetTypes (bool)
at System.Reflection.Assembly.GetTypes () [0x00000] in :0
at Pathfinding.AstarData.FindGraphTypes () [0x00000] in :0
at AstarPath.InitializeAstarData () [0x00000] in :0
at AstarPath.Awake () [0x00000] in :0

Okay. Which platform and build settings are you using?

I am building on Windows (64-bit) with the following settings:

Okay. Do you think you could try to replace your AstarData.cs file with this https://pastebin.com/0sKqYcGg (the important part is the FindGraphTypes method, in case replacing the whole file causes some other compiler errors in your slightly older version)?

Oops. Sorry. Made a typo in the previous file. Here is the one you should use: https://pastebin.com/FSAFxNWp

I think that worked! The error disappeared, grids.length is 1, and units are pathfinding again

Thanks for your assistance!

1 Like