i uploaded the bundles to the server, and when i start the game locally it works but when i build a webplayer and upload it to the server, it doesn’t work, i tried relative and absolute paths… what is going on?
is there something i should know?
please if someone knows, let me know about this.
i am banging my head with this for a while.
in what relation are the web build and files that need to be built? do i need to have hierarchy of folders or something.
locally it works, when i specify absolute path on the server like this www.server.com/unity/ and it works even if i have only file names…
when i upload build to server it doesn’t work…it starts but nothing is loaded…so i guess it cant find files. is this true???
can somebody assist me in diagnosing this problem
here is what i found out:
when i start the game localy i get this path from Debug.Log(Application.dataPath);
F:/Game/Unity/Project/Assets
when i start the game that i uploaded to the server i get this:
http://www.server.com/Unity
so, my question is, do i need to have the same folder structure at the server side as i have in Assets that are local folder?
and when building asset bundles do i need to build them with track dependencies or not to track?
thanks!
I think is is really up to you what path structure you want to use.
You should post some code too so that we can see how you are trying to load the asset bundle and where you might be making a mistake.
ok i solved the issue, it seems that it is working good:
function StartDownload(url:String,download : WWW){
if (url.IndexOf ("file://") == 0 || url.IndexOf ("http://") == 0)
download = new WWW (url);
if (Application.platform == RuntimePlatform.OSXWebPlayer || Application.platform == RuntimePlatform.WindowsWebPlayer)
download = new WWW (url);
else if (Application.platform == RuntimePlatform.OSXEditor || Application.platform == RuntimePlatform.WindowsEditor)
download = new WWW ("file://" + Application.dataPath + "/" + url);
progressString=parseInt(download.progress*100).ToString();
yield download;
assetBundle = download.assetBundle;
if (assetBundle != null)
{
var go : Object = assetBundle.mainAsset;
if (go != null)
instanced = Instantiate(go);
else
Debug.Log("Couldnt load resource");
}
else
{
Debug.Log("Couldnt load resource");
}
}