progress bar of the level in scene loaded

while loading a level from a scene i want to know how much % of the level is loaded to show in a progress bar in the project.

i am using Application.getStreamProgressForLevel(1);

Application.getStreamedBytes;

but no result

in Application.getStreamProgressForLevel(1);
i get 1 as o/p but in integer not float
but it shd b in [0…1] range float

in Application.getStreamedBytes;
i get 0 as o/p

any way how to get how much % of scene is loaded or application is loaded

plz reply

thanks

To confirm, is this being done in the browser? If so, are you sure that you build a streaming web player and not just a web player?

And when you say “no result”, what exactly do you mean? Silent failure? Script errors? Other? Surely something happens, what is that? :slight_smile:

thanks for the reply

i want to display progress of the scene being loaded in my proj while its loading the level

i my code i have loaded the level by script
Application.LoadLevel (1);

i am using the script
per = Application.GetStreamProgressForLevel(1);

per will give the percentage value of the level loaded

but i am getting 1 only as o/p

in unity scripting manual
its given that it will give float as o/p betwn [0…1]

can i get thr any way the % of the level loaded

i am using c# script

plz reply

thanks in advance

Thanks for that information but you missed what is likely the most important question that I asked. :slight_smile:

Please answer that for us, when you make your build are you creating a web player, or a streaming web player? You should me making a streaming web player if you want to do what you’re describing.

yes i have done it then also it is giving me the same 1 o/p that too in int aleast i am aspecting in float.

i have builded the whole proj with all the scene.
it would be wrong to ask u but i have no option.

can u plz assume a small proj of just consisting of empty scene displaying progress % on the screen.

just give me the detail of each code to be placed written.

plz reply
thanks

All of your code looks just fine. Can you share a sample project? Have you posted this online somewhere or are you only testing locally? In a local case the streamed progress will be 1.0 as the file is already local, posting it online is a more effective test if you haven’t done that already.

As to where this code goes, you could put it just about anywhere, put an empty game object in the scene, attach this code to that game object and have it display the progress in some GUI for example. Also, make sure your levels are large enough to require some amount of time to stream, perhaps you’re getting 1.0 values so quickly as the file is streaming down really quickly.

i have builded the project by Stream web player uploaded on internet server but it shows the float value(0.1678652) for once the plugin crashes(the level is not loaded it shows just that float(%) value )

plz reply

thanks

That’s the only other thing I can offer. Nobody else seems to have these issues and so I’m puzzled as to why yours is behaving so oddly. Perhaps you can both post a web player build for others to test and post a sample project as well (PM me the project URL if you want it kept private)?

In general, your code is right, this is the proper technique so something else is amiss…