- Home /
Error when running game as an EXE
My game uses many different scenes. My problem here is this: Every time the game is supposed to switch scenes when run as an EXE, it completely freezes or crashes. I use the command Application.LoadLevel for all of my switches, and it wouldn't be there if it didn't work (In fact, when in Unity everything works better than peaches with cream).
Is this a simple fix? Have any others experienced this problem? Am I simply doing something wrong?
Thanks for the help.
Answer by Piflik · Jul 16, 2012 at 08:21 PM
Application.LoadLevel alone doesn't create an error. I encountered freezes and crashes, usually when I created an infinite loop without realizing it. It might be something like that in your code, but without any information we can only guess.
Answer by Owen-Reynolds · Jul 17, 2012 at 01:00 AM
Do you manually open any files (like with new StreamReader
)? If so, they would need to be moved into a Resources folder, so Unity knows to include them in the exe.
Do you get any regular Unity errors when you switch levels? The editor will show them as debugger errors, but keep running anyway, so easy to miss them. Seems possible the same errors wold crash the build.
I do get regular Unity errors . . . Hmm, maybe I'll try and fix those regular errors.
Thanks.
Your answer
Follow this Question
Related Questions
Distribute terrain in zones 3 Answers
Problem with building project 0 Answers
Unity Build that supports wii 1 Answer