Hello dear Unity Community.
I’m fairly new to Unity and I’m trying to learn how to use AssetBundles in Unity as I will need them for the next app. I found this AssetBundle tutorial and decided to use the AssetBundleManager included in the downloadable sample project. In the ‘Build Settings’ I switched to Android Platform. I build the AssetBundles (for Android platform). I want to load a scene from the AssetBundle.
When I’m in the editor I used three different ways to load the AssetBundle scene.
First I tried it in 'Simulation Mode ', then the ‘Local AssetBundle Server’ and finally I uploaded the AssetBundle to a server and accessed it through the url.
Everything worked perfectly in the editor.
When I try it on my Android devices it won’t download from the URL.
I use the scene and AssetBundle given in the tutorial project.
The AssetBundle is named ‘scene-bundle’.
Let’s say I upload it to this site:
http://www.MyWebsite.com/AssetBundles/
then the AssetBundle file url would be this:
http://www.MyWebsite.com/AssetBundles/Android/scene-bundle
In the editor it worked when I gave this url:
http://www.MyWebsite.com/AssetBundles/
because the script detects which platform I’m in and the name of the AssetBundle is given in a string beforehand.
the Script-line reads like this:
AssetBundleManager.SetSourceAssetBundleURL("http://www.MyWebsite/MyAssetBundles");
In the comment above it says this:
Customize the URL based on your deployment or configuration
So my guess is, that I just can’t write the url like that and need to adapt it to Android?
The error I get is the following:
Failed downloading bundle scene-bundle
from
mywebsite.com is available for purchase - Sedo.com
Invalid Unity Web File (Decompression
Failure). URL:
mywebsite.com is available for purchase - Sedo.com
I tried to use WWW because I thought that might help, but I failed miserably.
All the answers I found were a couple of years old and nobody is using the unity AssetBundleManager. The tutorial is also fairly recent, Date: 11 Sep 2015.
Any help would be greatly appreciated.
I’m sorry for being such a noob, thank you for your time.