- Home /
404 Not Found, Problem with WWW:get_assetBundle
hi guys, I have mac target game and I build assetbundle and it is available in my website in game_files directory, I have this code for download assetbundle to my scene,
using UnityEngine;
using System.Collections;
public class LoadAssets : MonoBehaviour {
public string URL="http://www.mysite.com/game_files/KSA5.unity3d";
IEnumerator Start () {
WWW www = WWW.LoadFromCacheOrDownload(URL,1);
//wait for download to complete
yield return www;
AssetBundle bundle=www.assetBundle;
GameObject obj = bundle.Load("KSA-Rd-Kgfhd-705",typeof(GameObject)) as GameObject;
Instantiate(obj);
}
// Update is called once per frame
void Update () {
}
}
I got this error:
You are trying to load data from a www stream which had the following error when downloading.
404 Not Found
UnityEngine.WWW:get_assetBundle()
<Start>c__Iterator1:MoveNext() (at Assets/Scripts/LoadAssets.cs:11)
However I can read any think from my directory remotely. please some one can give me answer of this problem .. thanks
Answer by MSDs · Feb 12, 2013 at 01:13 PM
answer is here
http://answers.unity3d.com/answers/397915/view.html
http://answers.unity3d.com/answers/397920/view.html
thanks
This answer was deleted, can you help me with that? Have the same problem
Answer by Bunny83 · Dec 25, 2015 at 05:26 PM
Not sure why his original answer got deleted. He reposted the answer. I've fixed the link in the other answer.
However the linked answer is not a general solution. The error
404 Not found
Is a server side error that indicates that whatever you want to reach though the given URL can't be found / accessed. Common problems are:
wrong URL. Keep in mind that URLs are usually case-sensitive.
wrong server settings. The server might not allow a specific file extension to be accessed.
URLs are usually case-insensitive. I think it is a .htaccess misconfiguration issue
Not really. I didn't say they are always case sensitive, just usually. Per definition URLs are actually case sensitive except of a few parts. The scheme and host name is case insensitive but things like username / password usually are not. Everything else depends on the usage and implementation. Since most web servers are Unix / Linux based the underlaying filesystem is usually case sensitive. Therefore path and file names are also case sensitive. For query string and fragment identifier it depends on the usage. For example the media wiki software is case sensitive. That's why those two links are not the same:
http://wiki.unity3d.com/index.php/CoroutineHelper
http://wiki.unity3d.com/index.php/coroutinehelper
http://wiki.unity3d.com/Index.php/CoroutineHelper
By those examples you can see if the page name is't in the right case, the wiki software doesn't find it. Further more the last link has written Index.php
ins$$anonymous$$d of index.php
and you get a 404. That's most likely because the server is Unix / linux based like most servers on the net.