- Home /
could not open file file.png
hi guys,
i load png files with www class and create texture with www.texture, this work nice into
my unity project but in my build i have error in www this my error:
www.error -> could not open screenshot1.png
i am confused :s
this is my code:
function reload_pic()
{
url = "file://"+path;
www = new WWW(url);
yield www;
if(www.error != null)
{
error_msg = www.error;
}
else if(www.isDone)
{
pic_texture = www.texture;
}
}
Answer by Eric5h5 · Sep 01, 2013 at 03:51 PM
Your path is wrong in the build, but you didn't show how you create the path, so it's hard to be any more specific.
thanks in project is correct but i build is incorrect
but my code for path is :
info = new DirectoryInfo(Application.dataPath+"/Picture/Gallery/");
fileInfo = info.GetFiles("*.png");
for (file in fileInfo)
{
pic_array[count] = file.ToString();
//path = pic_array[count];
count++;
}
See the docs for Application.dataPath for what it actually is in a build.
Your answer
Follow this Question
Related Questions
Half image download from the server ? 0 Answers
Hololens url to texture is not working 0 Answers
iOS ignores html error headers? 0 Answers
WWW Class is acting up 1 Answer
Texture is not loading using WWW class in WebGL build. 0 Answers