- Home /
www object on android. what do i need to do?
code i have to get an assetbundle from my server works fine in the editor but when i publish onto a tabllt nothing is happening.
WWW www = WWW.LoadFromCacheOrDownload (@"http://my server/model_car.unity3d", 0);
yield return www;
Instantiate(www.assetBundle.mainAsset);
the assestbundle im testing it with is only 2kb.
am i missing somehting here? im using android pro
Did you get permissions to access the internet on the device? or any other permissions needed?
yeah it has full network access in the settings on the tablet. cant think of any other permissions.. i dont need any extra dlls or anything do i?
What is the mainAsset? A prefab? are you getting an error, have you tried setting the position and rotation so that it is 100% in front of the camera and viewable?
it is a prefab yeah, just a few cubes stuck together. it spawns right in front of the camera in the editor but ill set the position just to be sure, thanks
edit: yeah its definitely not there
i just remembered assetbundles arent compatible between systems, so i need to build it with the platform set as android i think. im too tired to concentrate properly. ill come back to it tomorrow. thakns
Answer by gheeler · Mar 08, 2013 at 10:50 AM
Finally found the answer in another question.
unity says to set the target platform, so i set it in build settings in the editor which is wrong.
in the build asset script there is an overload for this funciton:
BuildPipeline.BuildAssetBundle(Selection.activeObject, selection, path, BuildAssetBundleOptions.CollectDependencies | BuildAssetBundleOptions.CompleteAssets, BuildTarget.Android);
How this isnt highlighted in the documentation i have no idea...
sometimes the docs are rubbish
Your answer
Follow this Question
Related Questions
Unity download audio 1 Answer
How can i do youtube video player from video url for Android devices ? 0 Answers
WWW Form C# on Android 0 Answers
WWW Android Memory Leak? 1 Answer