Support Forum

Built Project - AI can't pathfind?

So, we are using this plugin to push out our 0.0.4v patch. However, the game is fully working in the editor no issues there. However, when we build the project all the AI are still (animation cycles are working therefore the FSM is working) but their pathing isn’t. We spawn the inner city section then scan the graph. That works, but does it only work in the editor?


Check the log. It might have some info for you.


Yeah, it was due to the scans not picking up static objects during runtime. So just cached then loaded them from byte files. But getting some weird behaviour so debugging. But people enjoyed the last patch if you want to check it out.

Ok, I am loading my cached scans correctly as I don’t call a .Scan(); when I load the area. The AI is perfect in the editor and the cached graph loads. However, in the built project the AI is certain area starts running between two point. I am assuming it is because that area that the player is walking on isn’t scanned… But it is from the cached scan. So static objects aren’t the issue and the loading cache isn’t the issue. Any ideas?


Are you seeing any errors in the player log when doing this?
Make sure to enable A* Inspector -> Setings -> Path Logging.

Hey, not seeing any errors. I am puzzled, in the editor it loads the cached graphs correctly. Like I don’t scan and I can see the grid work for all the areas. However, in the build I am getting errors. I am assuming that the graph isn’t loading correctly. I turned off static on all objects to ensure that wasn’t the issue. But it’s acting how the AI acts when the player is in an un-scanned area. I am going to quickly check the debugger build and see if I can solve it. Also figured that static isn’t the issue cause I cached the graphs. Really hoping to have this issue solved this week.

Ok, managed to isolate the error… So I have saved graph as a text asset file. It is the put on a Scriptable Object containing all the data for the section of the city. We then load the scriptable object from resources. Then we deserializeGraphs the bytes file. It works in the editor. Am I missing something with the build version be being able to use this function?

What error do you get when trying to use that function in the build?

It’s just a null reference exception like it is empty… But that only occurs in the built version.
It works 100% in the editor

Well if the error happens before you even pass the data to the deserialize graphs function then there’s some error in your end. Maybe it’s not being loaded properly from the resources folder?

Hello Aron,
I dived into the code and found the error. Well wasn’t an error at all hence why there was not any debugs to follow. But it was due to the fact I was loading the cached graphs in the awake function. Which did load them but the project initialises in the awake. Therefore got some dodgy behaviour. My mistake, cheers again!

1 Like