Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by MC73 · Jan 14, 2018 at 12:27 AM · error messageassetbundleasset bundles

Unity AssetBundles error message

I have a Scene as a Unity "AssetBundle" to load, because this scene is well over 4GB in size and therefore no longer properly exported over the normal build.

The problem is, I always get an error message when loading the AssetBundle.

Error message: "Assertion failed: Assertion failed on expression: 'm_UncompressedBlocksOffsets [blockInd] <= from + dstPos && m_UncompressedBlocksOffsets [blockInd] + uncompressedBlockSize> = from + dstPos"

My script for loading AssetBundles:

  IEnumerator SceneLoader()
 {
      var bundleRequest = AssetBundle.LoadFromFile(Path.Combine(Application.streamingAssetsPath, "gamescene"));
      yield return bundleRequest;

      if (bundleRequest == null) 
      {
            Debug.LogError("AssetBundle could not be loaded!");
            yield break;
      }
      SceneManager.LoadSceneAsync("GameScene");
 }







Comment
Add comment · Show 10
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Brogan89 · Jan 14, 2018 at 12:41 AM 0
Share

Wouldn't you want to load your scene first, then load the assets into it? Rather than loading the assets then loading the scene. I dunno, it seems backwards.

Also, you don't need to use Path.Combine() you can just use Application.strea$$anonymous$$gAssetsPath + "/gamescene". It's no big deal, but just looks nicer.

but I use a callback delegate to retrieve the asset bundle.

I do something like this :

 public IEnumerator GetAsset(string bundleName, Action<AssetBundle> callback)
 {
     AssetBundle _bundle = AssetBundle.LoadFromFile(Application.strea$$anonymous$$gAssetsPath + "/" + bundleName);
 
     // custom exception
     if (_bundle == null)
     {
         Debug.LogError($"AssetBundles: Failed to load AssetBundle! '{bundleName}'");
         yield break;
     }
     
     // calback
     callback.Invoke(_bundle);
 }


But I store all my assets in a aws-s3 bucket, so I don't actually get them from local disk. Little bit different. But the same logic applies.

avatar image MC73 · Jan 14, 2018 at 12:52 AM 0
Share

I can not load the scene first, the scene is the asset bundle

avatar image Brogan89 MC73 · Jan 14, 2018 at 01:08 AM 0
Share

Oh right, of course. Sorry, I forgot you could do that.

I think it might be because you're calling "GameScene" but need to call the complete path.

try using this code

 string[] scenePaths = assetBundle.GetAllScenePaths();
 string sceneName = System.IO.Path.GetFileNameWithoutExtension(scenePaths[0]);
 Scene$$anonymous$$anager.LoadSceneAsync(sceneName);

But to be honest, I have no idea about that error message, never came across that before.

avatar image MC73 Brogan89 · Jan 14, 2018 at 01:18 AM 0
Share

That does not work, I suspect it is due to this line: var bundleRequest = AssetBundle.LoadFromFile(Path.Combine(Application.strea$$anonymous$$gAssetsPath, "gamescene"));

Show more comments
avatar image anuragaofl · Oct 14, 2019 at 09:31 PM 0
Share

Were you able to fix this @$$anonymous$$C73 ?

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

79 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How to import the object from server to unity 2 Answers

How to build only specified assets into assetbundle in unity 0 Answers

How to build asset bundle without dependencies? 1 Answer

Asset Bundle vs Texture 0 Answers

Can I set an Asset as Addressable at Runtime? 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges