I’ve got some problem with Unity3d WWW class.
I’m trying to get string from an URL, it works fine in unity editor, but when I build into Web Player, it does not working. its like the coroutine always trying to get data (I’m not set the time out), but got nothing, “WWW.error” properties is also null, if I use “while(www.isDone){}” it will be blocking (never enter into the scene/level). Can anyone help?
here are the coroutine code:
public IEnumerator SubmitLogin()
{
WWW download = new WWW("http://targetdomain/index.php?op=login&username=user&password=pwd");
yield return download;
// this is will be blocking forever in web player
//while(!download.isDone){}
if(download == null)
{
Debug.Log("download data is null");
}
else
{
//_sessionId = download.text;
Debug.Log(download.text);
}
if(download.error != null)
{
Debug.Log("Download error" + download.error);
_sessionId = "SESSION EMPTY, " + download.error;
}
}