Bundle Asset works only inside editor
I have the following script that downloads the scene using assets bundle from my server and runs it:
using UnityEngine; using UnityEngine.Networking; using UnityEngine.SceneManagement;
public class Loader : MonoBehaviour { private AssetBundleCreateRequest bundleRequest; private UnityWebRequest request;
private void Start()
{
request = UnityWebRequest.GetAssetBundle("https://drive.google.com/open?id=1uR1wiZCLP6fZxJHgRW7iPdOpHR21WQPl");
request.Send();
}
private void Update()
{
if (request.isDone)
{
AssetBundle bundle = DownloadHandlerAssetBundle.GetContent(request);
SceneManager.LoadScene("Level1");
}
}
}
My game works properly inside the editor but once I build it on Android and test the APK the scene doesn't load. Please advise.
Your answer
Follow this Question
Related Questions
load .unity3d assetbundle from resource folder 0 Answers
Cannot get Addressables to work after successfully build onto Android? 1 Answer
Can i build an Asset Bundles with Unity Free Version? 1 Answer
AssetBundle (DLC) data load to Android phone at runtime 0 Answers
How to remove inside of assetbundle camera in unity? 0 Answers