|
Hello ---------- I have problem to get image from path at runtime.
var pic : Texture2D;
function Start()
{
var pic2 : WWW = new WWW ("file://C:/Test.png");
yield pic2;
pic = pic2.texture;
}
and give me this error You are trying to load data from a www stream which had the following error when downloading. Couldn't open file /Test.png But when I change the root to //D it is work fine var pic : Texture2D; function Start() { var pic2 : WWW = new WWW ("file://D:/Test.png"); yield pic2; pic = pic2.texture; } thx for help ....
(comments are locked)
|
|
Try this method i hope i will help full Is that C# ? There should be a method in there.
Jun 06 '12 at 02:54 PM
Berenger
thx for all who try to help me
Jun 06 '12 at 08:45 PM
firasdeep
yes it is c# code the bottom 5 lines u can keep in ur required function
Jun 07 '12 at 04:44 AM
mohanrao164
(comments are locked)
|
|
use "file: //C:/Test.png",just add one whitespace after 'file:' it works on my pc This is the only workaround, that fixed it on ALL of our Windows-PCs. (not tested on OSX)
Jan 29 at 10:58 AM
JanWosnitza
Finally we figured out the real issue :D According to File URIs in Windows file urls have to be formated like "file:///C:/ProgramFiles/...".
I believe Unity accepts the space version ("file: //C:/..") just because it has a very basic parsing implemented (e.g. if ( url.StartsWith( "file" ) ) url = url.Substring( 7 ) ) I recommend to build file urls like:
Jan 30 at 09:37 AM
JanWosnitza
(comments are locked)
|

Me : Test.png is in D:, not C:, simple as that.
firasdeep : no I have copy in C , E and D but not working in C and E only work in D root
thx for you try
I have Unity 3.4.1, is there are any bug in WWW in this version
Me : My answer isn't relevant, moved into to comments so your back in the unanswered list.
If you're absolutely sure the file exists, I wonder if there might be a permissions issue. Maybe try some location other than the drive root.