- Home /
Code working on editor but not once builded
Hello!
I'm getting crazy, Some code works while playing in unity editor, but once running the .exe of the windows build it does not load the "imports" array...
What can be happen, and how can i trace it, because once builded i can not debug the code... or what can I do?
the code simply copy an array to a script which have a "DontDestroyOnLoad". and when enetring the scene again, it loads that array.
Is perfectly working with a lot more of other arrays and variables, and is working in the editor... but not once running the .exe
Answer by tormentoarmagedoom · Dec 07, 2017 at 04:58 PM
Ok, i found a "solution" and the "problem"
What i think is that in the editor, all Start() of all scripts are not executed in the same order as in the .exe file.
So the Start() of the script where the "imports" array is loaded was not executing at the same order place at the Unity Editor than the .exe file.
I just changed the start for an Update() with a bool checking if it has been done, so it only execute that the first Update of a Scene.
bye :D