- Home /
(SOLVED)LoadLevel takes 3s in editor and 30s (!) after build.
PROBLEM SOLVED :) I forgot that during the floor generation I was outputting many, many things to Debug.Log. Deleting lines of script responsible for this solved the issue.
Hello!
All of my transitions from one scene to another work ok, with one exception. When I use LoadLevel(string) to load my main game scene and I try to play the game in Unity Editor, the scene loads in about 3 seconds. But when I build the game and then try to play the built version (on Win7) loading that scene takes up to half a minute.
Probably the most complicated thing that happens in the Start() functions of objects that are in that scene is generating a floor made of rooms. The algorithm is simple and back when I did it in C++ Allegro 5 it took less than a second.
I'm not sure what takes it as much time as the 3 seconds that I have to wait in the Editor, but I'm even more baffled by the fact that it takes that long (~30s) in the built version. What's wrongwith this?
The game is made just for training (I'm still learning the basics) so I can share any parts of the code with you. Just tell me, what you want to know.
Thanks for helping me!
Best Regards,
kaka24fan
This is most likely because you've been working on the scene while playing in the editor, so a decent chunk of it has already been pre-loaded. When you load the level in the build, however, all data needs to be re-loaded.
Never$$anonymous$$d, I solved the problem, but thanks for your effort. I'll remember what you said, maybe it'll come in handy in the future :)
Good to hear you found the solution by yourself! It's really hard to believe how much debug logging can slow down the game.
Your answer
Follow this Question
Related Questions
Distribute terrain in zones 3 Answers
Why is my build running so slow despite running fine in editor? 2 Answers
Game runs normal on editor, but it's slow on build 1 Answer
Build extremely slow 1 Answer