Once my main menu screen is loaded, the user presses the play button and it goes to load up the actual game level. This loading takes about 15 seconds, which ontop of the Made with Unity splash screen is long. Is there a way I can put in a “Loading Percentage: X” piece of text on the bottom, or ideally a bar? Is there a command that will return how much of the level is loaded on the iPhone? Or if that can’t be done, can you do any processing (like a minigame) while something is loading? I read something about how you maybe can’t, and wanted it clarified. Let me know what you think.
I’m not sure. However in my game, Night Divine, I have a “loading” level that I tried to put some particle system on that users could watch while the next “real” game loaded… but the particles didn’t animate, it was like Unity was paused (bogged down) while it was busy loading the game data.
How to get a Game Level Loading progress in unity3d ? Have you any idea ?
You could use a native function (obj-c) to show up a bevel turning. Prime31’s plugin allow this with one line of code and will show a view + a message while your level is loaded.
I load in a transition scene that has a cool background with a spinning load wheel (like a lot of console games) that just rotates, it does not give a percentage, but it does show the player that the level is still loading and the game did not crash or something, then I load my next level with Application.LoadLevelAsync so the spinning wheel still runs.
Thanks for the tip!!
I have tried this, but when the level loads for 5-10 seconds it is very bogged down. it doesn’t happen with the normal level.
Did you encounter this?
Is the Profiler available for you?
Would be very interesting what the game is doing in that time.
Okay with the risk of sounding very dumb, what is the profiler?
Basically it drops to 6-7 fps instead of the normal 60-70 fps.
i guess a choppy spinny wheel is better then non at all huh loll
thanks for the tip crazy! im going to try to implement this in my game for sure!
Actually it isn’t the “spinning wheel” part that is the problem. It is the level that is loaded.
I can get the loading screen to work okay, but the actual level is totally lagged for 10-15 seconds which doesn’t happen with the standard loadlevel.
I don’t know if i am just missing a step.
that sounds like the “new textures are not loaded behind the loading screen to be rendered in front of the view, so they are in vram” optimization you are missing so it stutters every time a new texture not seen previously is seen by the cam
I load in a blank scene to purge memory using the normal Application.LoadLevel, and then I load the transition scene with a script that randomly loads in a background (170 kb) texture from the resources folder also using the normal Application.LoadLevel. The spinning wheel is just a sprite that rotates using function Update. Then I load the main scene with Application.LoadLevelAsync. It works for me, but if someone can optimize it better, that would be great. I can attach my script later tonight.
How would i fix this? It is driving me mad and makes it unusable. I don’t know how to change these settings. But it doesn’t happen with the normal loadlevel, just loadlevelasync.
Seriously… the whole engine stopping while LoadLevelAsync is loading my next level is driving me insane. Has anyone found a solid answer for this? It seems like all these discussions just fizzle out.
Here are the specifics of my case:
-
Using Pro
-
Running on Android
-
Don’t have anything heavy in any of the start/awake functions of the scene being loaded
-
The old scene (with a progress meter, reading off the progress of the async operation), as expected, is still loaded while the async operation is underway, The progress meter, however, practically stops at like three frames per minute.
-
I put a debug.log msg on Update(), just to see what was going on… it ran about seven times, sporadically, during the ~30 second load.
-
I tried, as suggested in another thread, using
while(!asyncOpLvlLoad.isDone)
{
yield return 0;
}
as opposed to just yielding the async op. No luck.
I’d really appreciate any help with this, what a pain in the butt.
i never found a solution and ended up just loading and in between loading level to solve the issue for me. Pretty bad solution but i couldn’t spend the time to make it work (if even possible)
I’ve been wanting a solution for this as well, found a alright solution but wish it was better.
I have unity pro so I can use Application.LoadLevelAdditive and Application.LoadLevelAdditiveAsync, except AsyncOperation.progress is completely useless, essentially completed in 1-2 frames, then spends 5 seconds initialising the scene.
My current solution is using a SceneLoader script, which is set to high priority in the in script execution order, it gets all the game objects deactivates them, then enables them.
The SceneLoader script provides much more useful progress variable which is just loaded gameobjects / total game objects. It also sends a message to all the game objects at the end of loading with a OnSceneFinishedLoading which I use instead of awake and start. Any object I put the script SceneObject can have a priority too as it get handled in a determined order.
I dont really like this method though as due to my current implementation, as I like to create generic reusable code and I cant do that so much as start and awake are not so usable in my current setup.
Anyway I would love to hear if anyone has figured out a elegant solution to loading scenes with progress bars loading screen.
EDIT: I should mention that my project is not iOS specific. I found this thread from a search and posted without realising it was in iOS section.
just use AsyncOperation.progress
Multiply the progress value by 100 this is because AsyncOperation.progress gives you between 0 and 1 but rounds the value off for some reason, so it doesn’t work. By multiplying by 100 it works. For my NGUI slider value it needs between 0 and 1, so i divided by 100.
That’s what I did for a game I’m working on, here’s a video of it in action:
Lots of people keep saying that as the solution to the million posts on this topic, but like a lot of other people as well, that just will not work for me
The AsyncOperation is completed in a single frame, it then takes 4-6 seconds to initialise the scene.
So again, still looking for a solution as AsyncOperation will not work!
Have you actually tried it on the device? It only works properly on the device