Make an empty object on your scene and attach this script to it:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Networking;
using System;
public class BundleWebLoader : MonoBehaviour
{
public string bundleUrl = "http://localhost/assetbundles/testbundle";
public string assetName = "BundledObject";
// Start is called before the first frame update
IEnumerator Start()
{
using (WWW web = new WWW(bundleUrl))
{
yield return web;
AssetBundle remoteAssetBundle = web.assetBundle;
if (remoteAssetBundle == null) {
Debug.LogError("Failed to download AssetBundle!");
yield break;
}
Instantiate(remoteAssetBundle.LoadAsset(assetName));
remoteAssetBundle.Unload(false);
}
}
}
Don’t forget to specify your correct url to the asset bundle you want to reach and the name of object you need.
Watch this video demonstration to see more:
loading...
My 3d model is getting loaded at some random position, i want to load the 3d model as the child of ImageTarget and instantiate it at 0,0,0. How can that be done ??
Hi friend… thanks for asking this. I already answered your question on YouTube.
hi. i need a way to permanent add downloaded objects, just like add DLC to a game. because i dont want to download them again and again. this tutorial can do it?
Thanks for the comment. Unfortunately I don’t even know what DLC is and how it works.