- Home /
WWW.progress doesn't work
Hi there, we are building an Android / iOS game which has lots of levels as asset bundles to be downloaded by the player.
For some reason WWW.progress doesn't work while trying get the downloaded percentage through log or UISlider. It returns 0 at the beginning and 1 at the end but nothing inbetween. Anything wrong with concept or code here?
WWW www = WWW.LoadFromCacheOrDownload ("http://*our host*/Yo.bundle", 1);
while (!www.isDone)
{
progressBar.value = www.progress;
Debug.Log ("Download = " + www.progress);
yield return null;
}
Thanks in advance.
Is this feature not supported for Android / iOS or doing something wrong here?
Answer by unimechanic · Oct 09, 2014 at 03:17 PM
Check the first code example in this document:
http://docs.unity3d.com/ScriptReference/WWW.html
It uses a coroutine:
Thanks for the reply.
Am I doing anything different from the example that you suggested? Except that I am using WWW.LoadFromCacheOrDownload?
I am using coroutines as you can guess (at line no 6).
The code that I posted works perfectly on Standalone build. But mysteriously doesn't work on Android.
I am facing the same problem, the progress works in the editor but not in Android.
I suspect Header stripping from Android side but not sure. $$anonymous$$g. the status-Code is also not passed to Unity.