- Home /
red question mark loading image as texture with WWW
Works fine in the editor but when i build for android it shows me a red question mark. Yes i've tried with other images, and yes i've tried with local images.
var url = "https://www.google.com/hangouts/img/desktop-gmail.jpg";
function Start () {
// Start a download of the given URL
var www : WWW = new WWW (url);
// Wait for download to complete
yield www;
// assign texture
renderer.material.mainTexture = www.texture;
}
Answer by kromenak · Oct 23, 2014 at 06:21 PM
The red question mark means that the texture you're requesting couldn't be retrieved. In the past, I've seen this if the URL doesn't actually point to an image.
Since your image is valid...maybe you can't access the internet on the device? Have you added the INTERNET permission to your Android manifest?
List of android permissions: http://developer.android.com/reference/android/Manifest.permission.html
How to add permissions to the manifest: http://developer.android.com/guide/topics/manifest/manifest-intro.html#perms
If it's not that...then I'm not totally sure. Have you tried connecting to ADB while making this request to see if any errors are generated in the device log?
Also, in my case I was trying to fetch a Facebook profile pic. Apparently the URL path to that expires after a couple days. http://stackoverflow.com/questions/30477877/facebook-image-url-gets-expired
Answer by wderstine · Oct 13, 2017 at 04:12 PM
Also if the image you're getting is in CMYK it won't load on Android. I had a problem with pulling images from a webpage being in CMYK.
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
How to assign texture from url 1 Answer
null texture passed to GUI.DrawTexture 0 Answers
Loading Pictures from Android Device into game at runtime 1 Answer