- Home /
simple WWW code works in editor but not on server
var www;
var cube:GameObject;
function Start() {
www = new WWW("http://www.mywebpage.com/game/unitytest2.php");
yield www;
if(www.text == "hello"){
cube.renderer.material.color = Color.blue;
}else{
cube.renderer.material.color = Color.red;
}
}
The php code resides in the same directory on the server and the php code simply echo's "hello" to the client. There is a crossdomain.xml file in the root and in the local directory where the unity file, html page, and php files live. Any help is appreciated.
Answer by DaveA · Nov 18, 2011 at 08:53 PM
Test the server by hitting that url with Firefox or something. Put a Debug.Log(www.text) in to see what that is coming in as.
Answer by uni · Nov 20, 2011 at 03:32 AM
OK. The project was originally a Unity 2.6 project and was upgraded. It works fine from scratch.
Your answer
Follow this Question
Related Questions
WWW fails in Webplayer but not Standalone 0 Answers
upload png receives multiple results from server 0 Answers
webplayer crash when use www download assetbundle 0 Answers
Web-project "Session End" 0 Answers
WWW access Problem 2 Answers