Search Unity

Level loading progress

Discussion in 'Editor & General Support' started by The.Xander, Mar 27, 2007.

  1. The.Xander

    The.Xander

    Joined:
    Mar 22, 2007
    Posts:
    3
    Hello,
    this is my first post. I surely do not want to be annoying, but I couldnt find any help in the forum search.
    Is there a way to determine the loading percentage of a level in Unity?

    Thanks,
    Xander
     
  2. forestjohnson

    forestjohnson

    Joined:
    Oct 1, 2005
    Posts:
    1,370
  3. milkytreat

    milkytreat

    Joined:
    Jan 15, 2007
    Posts:
    267
    Yoggy: thats loading another gameworld tho, not another level. Which poses many headaches because everything in the previous gameworld is destroyed.
     
  4. forestjohnson

    forestjohnson

    Joined:
    Oct 1, 2005
    Posts:
    1,370
    Yeah I know, but it is the only way that one can get a progress bar.
     
  5. replay11

    replay11

    Joined:
    Dec 24, 2007
    Posts:
    168
    Is this still the case now that Unity 2.0 is out? I find it hard to believe that at this stage of the game no one has developed a simple loading progress bar to show the status of a game level being loaded? Not a progress bar to load the Unity Web Player, but a Progress Bar to show the status of a game level. Basically, this is what in the Flash world we call a "preloader". Someone must have created a preloader for Unity levels by now right? The only thing that I could find after searching the docs and the forum was a script to show the loading percentage displayed as a number, not a progress bar and I'm still in the process of testing it to see if works correctly. If it is the sad truth that no one has accomplished this yet then I will try and port one of my Flash preloaders over to Unity code. But first, can someone tell me whether or not this has already been done?
     
  6. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Well, a number is a number. Whether you're printing it as a number or using it to display a status bar is basically irrelevant. Anyway, yes, check out some of the more recent Unity web games like Cuttle Candy, Tennis Stars Cup, etc.

    --Eric
     
  7. replay11

    replay11

    Joined:
    Dec 24, 2007
    Posts:
    168
    It's irrelevant to you because your obviously not a designer!
    That's great that there are some published Unity web games with progress bars, but how can everyone else create one? Are they giving away their preloader progress bar script? Is there a tutorial somewhere on how to create one?
     
  8. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    I spent 9 years as a graphic designer. ;) I mean it's irrelevant, because a number can represent anything. It can be just a number, or it can be a color, or it can be bar, because a bar is just a graphical representation of a number. Everything in a computer is a number or a bunch of numbers.

    The games I mentioned actually use % numbers. Anyway, you should always check out the works in the Showcase forum, so you can see what people are doing. There are at least a few topics around here about bars of various sorts. There was one today about health bars, but that's exactly the same thing as a progress bar except that it's used for health instead of progress....

    --Eric
     
  9. Foxxis

    Foxxis

    Joined:
    Jun 27, 2006
    Posts:
    1,108
    There's a bigger issue regarding level indicators IMHO. As far as I know it's impossible to do anything while a level is loading in standalone mode. So, no progressbar or similar in standalone games. :(
     
  10. gr33nl1nk

    gr33nl1nk

    Joined:
    Dec 19, 2008
    Posts:
    92
    Im thinking of putting one game object in the scene which contains all the initial prefabs that need to be instantiated when the level starts, and then use a coroutine to instantiate those prefabs one by one while showing the progress to the player, I tried that and it kind of works, except that for every level designed by the designer, I need to write another editor script to pack the level prefabs into one preloader object. any better idea?
     
  11. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    This topic is kind of old...if you have Pro, progress bars while loading levels asynchronously been no problem since 2.6.

    --Eric
     
  12. gr33nl1nk

    gr33nl1nk

    Joined:
    Dec 19, 2008
    Posts:
    92
    yes, I realized this topic is old, but I never knew that this problem has been solved since 2.6, I have pro license, so you mean, I just need to attach a script to show the progress? but how do I keep track of the level loading progress? Application.GetStreamProgressForLevel is just for webplayer, isnt it?
     
  13. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Look in the functions for the Application class.

    --Eric
     
  14. gr33nl1nk

    gr33nl1nk

    Joined:
    Dec 19, 2008
    Posts:
    92
    Got it. Application.LoadLevelAsync would do. Thanks a lot!
    I really didnt notice it was there D: all this time I'd been thinking to make my own, but its really troublesome.
     
  15. gr33nl1nk

    gr33nl1nk

    Joined:
    Dec 19, 2008
    Posts:
    92
    the AsyncOperation.progress doesnt seem to work though, it jumped from 0 to 1, probably I have to make a fake counter then D:
     
  16. Neodrop

    Neodrop

    Joined:
    Oct 24, 2008
    Posts:
    1,359
    Yes, I confirm. This method do not work.
     
  17. bbvrdev

    bbvrdev

    Joined:
    Aug 11, 2009
    Posts:
    221
    Has anyone ever solved this? I'm still trying to get a progress bar working with LoadLevelAsync, and still it stays at 0 until the scene loads.

    When you load objects into an empty scene and create a "fake" progress bar, doesn't the actual game scene remove them from memory? If not I will try this method..
     
  18. bbvrdev

    bbvrdev

    Joined:
    Aug 11, 2009
    Posts:
    221
    So, shameless bump, does anyone know how to get AsyncOperation to output properly?
     
  19. Evan-Greenwood

    Evan-Greenwood

    Joined:
    Aug 6, 2008
    Posts:
    98
    I'm also having this problem. The progress of the AsyncOperation jumps from 0 to 1 and there is a lag in between.

    Does it only work in the Web Player or something... I can't get it working in Standalone or iOs mode.
     
  20. Cawas

    Cawas

    Joined:
    Jan 14, 2010
    Posts:
    121
  21. ptdnet

    ptdnet

    Joined:
    Apr 20, 2011
    Posts:
    100
    asyncoperation.progress is bugged. it reports 0 or 1, nothing between
     
  22. JorobusLab

    JorobusLab

    Joined:
    Jul 3, 2014
    Posts:
    78
    Is this fixed right now? I'm thinking that if the level is "cheap" to load it will do quickly, that's why jumps from 0 to 1. Am I right? Do someone tried with a "bigger" level?