- Home /
lo qual
LoadLevelAsync coroutine reloads level repetedly
I have encountered a problem that has completely thrown me. I have a main menu with three options to start the game and a loading text that is managed by using LoadLevelAsync. My issue is that when I load the game from the first two options (Level attack and Standard) the game operates as normal with no issues. However, when I load the game from the third option (Endurance) the scene will constantly reload and occasionally cause the game to nearly crash. This is my code for the function.
(redacted)
"(It's a mess, I know.)" :(
the best advice i can give is to clean it up first.
you've got control logic all over the place and loading from more than one place too - moving it to a single piece of code will help with clarity and make it much more readable for you and anyone who might need to help, although your errors might disappear if you rewrite this ;)
Yeah, it was written a while ago when first starting Unity. I think that rewriting it would probably be the number one priority right now.
UniversalError, I sent you a reward point for effort! Enjoy the UI system, it is incredibly easy to use.
Answer by Fattie · Dec 22, 2015 at 10:15 PM
You simply
cannot do
what you are doing. Sorry for the bad news.
You must use Unity's UI system.
It is incredibly easy - it will take you literally less time than it took me to type this.
Click once to add a Canvas
. Click again to add a Button
.
You're done - go prepare for Christmas.
A useful tip for you when making your first UI is, generally select "Scale With Screen Size":
Fortunately there is literally nothing to learn with the UI system. If you do the two clicks I describe above you're a top expert. Nothing more to know.
Regarding the code you posted there are so many problems it would not be practical to address them. It is not conceptually possible to do what you're trying to do. Cheers and good luck.
I just want to be certain that I'm following correctly. Are you saying that I can only have a level loaded asynchronously by using UI components?
I've rewritten the code using the same methods as before but using logical structures (y'know, like any sensible coder) and it works now. I'm not sure what you meant when you stated that what I was doing wasn't possible.
Seasons greetings to you too. Could you explain what you thought I was doing please? I honestly can't figure it out.
Follow this Question
Related Questions
Switching scenes 1 Answer
loading progress scene slows down game framerate 1 Answer
Additive async loading breaks my lightmapping on mobile devices 0 Answers
Default Cursor hourglass during app load 2 Answers
Seamless Room Transitions 0 Answers