when I Upload the unity file and html to the server, www.error always returns null.
it works fine however if I open the html file on my disk without uploading it to the server.
I’m using 2.5
when I Upload the unity file and html to the server, www.error always returns null.
it works fine however if I open the html file on my disk without uploading it to the server.
I’m using 2.5
www.error returns if an error has actually happened (e.g theres no internet connectivity, so unity couldn’t send the data, or the page doesn’t exist). The best way to use www.error is something like this:
mywww=WWW("http://....");
yield mywww;
if(mywww.error){
print("Error: "+mywww.error);
}else{
print([url]www.data[/url]);
}
hope that helps!
hello luke, thanks for replying.
I’m doing just as u indicated and in ur code:
mywww=WWW(“http://…”);
yield mywww;
if(mywww.error){
print("Error: "+mywww.error);
}else{
print(www.data);
}
the statement “if(mywww.error)” always returns false when i build for web and host my files on the server (hosted by doteasy.com)
it works fine, however, when I build for web and play it on my computer locally (returns true sometimes and false other times as expected).
If your using an ip address (e.g http://123.123.123.123/) or localhost (http://localhost/ or http://127.0.0.1/) in the WWW then that is most likely the cause of the problem. Calling ‘localhost’ makes it look around the computer that is currently running the unity client and not on the net.
If that’s not the cause of the problem then have you:
or
Also it might make a difference if your using ‘web player streamed’ as the build method. I’ve always found that the ordinary web player is better to use