If I build my project to windows or mac it completes the build. Then if I run the exe it freezes before getting to the 3d scene I have.
The titlescreen works fine.
It works if i build it to the webplayer. I have tried different resolutions and graphics qualities but all fail.
It is possible I have damaged the project files as I made the mistake of installing 3.5 beta and using that to continue development. The build crashes from 3.5 as well. I reinstalled 3.4.2f3 and imported all the assets. I had to do some work to get the project running in 3.4 again.
I find it odd that it works fine in the web player but not as a windows .exe.
Thank you to the Unity Support staff for solving my issue.
I was getting a Data/level0’ is corrupted! Remove it and launch unity again! [Position out of bounds!] error
But only on running a compiled .exe. Worked fine in the editor and as a webplayer.
The problem was the code #if UNITY_EDITOR
public bool infoScreenOpen; #endif
in the Base.cs file in the AstarPathing script.
It seems that Unity does not support variables being removed by the preprocessor.
Unity Support said:
We don’t currently support building a standalone or mobile player that has data members conditionally removed by the preprocessor directives so that the class data differ in the editor versus the player.
Once I commented out the If statement the build exe ran fine.
Hope this might help anyone else with similar issues.
I believe it only causes an issue if the comment is conditional using the #if UNITY_EDITOR construct.
This means you can comment properties for diff systems ie. iphone, pc , mac. But cannot have variables that are used inside the Unity environment but not in a runtime.