- Home /
WWW failed loading with new Unity Player
When i updated my Unity Player from 4.3.3.30826 (Unity 4.3.3f1) to 4.3.5.32006 (Unity 4.3.5f1) my facebook friends avatars failed to load with error:
Failed downloading https://graph.facebook.com/509896092/picture?width=128&height=128
With old version everything is fine. It looks like url-redirect is disabled in this version or something else. Please note that in UnityEditor everything is fine, but when build web version it stop working well. Code:
IEnumerator Start ()
{
WWW loader = new WWW(string.Format("https://graph.facebook.com/{0}/picture?width=128&height=128", 509896092));
yield return loader;
if (loader.error != null)
Debug.LogError(loader.error);
Debug.LogError(loader);
userIcon.mainTexture = loader.texture;
}
Answer by chaosmaker · Mar 05, 2014 at 02:59 PM
I confirm the bug and submitted a bug report to Unity for this..
Thanks. Unity QA Team returned me back quickly:
"Hey,
We have been able to reproduce this bug and have sent it for resolution with our developers. We cannot say when the resolution will be publicly available.
We highly appreciate your contribution. If you have further questions, feel free to contact us."
Answer by crazybaz · Mar 06, 2014 at 04:35 AM
I got one solution, on case with facebook avatars:
IEnumerator Start ()
{
WWW loader = new WWW(string.Format("https://graph.facebook.com/{0}/picture?redirect=false&width=128&height=128", 509896092));
yield return loader;
if (loader.error != null)
Debug.LogError(loader.error);
else
{
Dictionary<string, object> obj = JsonReader.Deserialize(loader.text) as Dictionary<string, object>;
Dictionary<string, object> data = obj["data"] as Dictionary<string, object>;
string url = data["url"] as string;
WWW ava = new WWW(url);
yield return ava;
userIcon.mainTexture = ava.texture;
}
}