I am trying to do pull the texture from the server and apply it to my gameobject.
I have used the below code for this function:
private string url = "http://www.camelcitydispatch.com/wp-content/uploads/2013/08/Fire-Hands-Screensaver_1.jpg";
private WWW www;
public Material matl;
// Use this for initialization
IEnumerator Start () {
www = new WWW (url);
yield return www;
matl.mainTexture = www.texture;
}
this code working fine in the unity editor, but when i export it to the webplayer it is not working. Please tell me how to solve this and how to make it run.
Hi there, I think it could be restrictions because of security reason. The Unity webplayer expects a http served policy file named crossdomain.xml to be available on the domain you want to access with the WWW class… see here more information how it using http://docs.unity3d.com/Documentation/Manual/SecuritySandbox.html