I try to load assetbundles in a Web GL build. The bundles are stored in the “StreamingAsset” path. When I test this on a local server (xampp) it works like a charm.
As soon as I upload it to a hosted server I get the error “Failed to decompress data for the AssetBundle” when trying to load the bundle.
Code for loading the bundle:
using(WWW www = new WWW(assetPath+"/"+bundleName))
{
yield return www;
if(!string.IsNullOrEmpty(www.error))
{
kgAGame.instance.logger.error("error while creating asset bundle from file: "+assetPath+"/"+bundleName+": "+www.error);
yield break;
}
kgAGame.instance.logger.info("fetched asset bundle from file: "+assetPath+"/"+bundleName);
_bundles.Add (bundleName,www.assetBundle);
yield return null;
}
This is the error I get:
File rights on the hosted server are all set to 777 for testing. Path to the bundle is also correct. I am no web developer pro, do I miss something? Or do you have any ideas what could cause this error?