Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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
0
Question by WhiskeyJack · Jan 25, 2012 at 04:15 PM · assetbundlefreezeloadlevel

Long freeze when loading level from asset bundle in Application.Integrate Assets in Background

I'm experimenting with asset bundles and have it now working so that I can load a level from an asset bundle with this code:

 IEnumerator PreloadLevel (string levelUrl){
     WWW www = WWW.LoadFromCacheOrDownload (levelUrl, versionId);
     yield return www;
     if (www.error != null) {
         Debug.Log ("WWW error: " + www.error);
     }
     var ab = www.assetBundle;
 }

I then load the level with Application.Loadlevel. However, Unity freezes for about 5 seconds before the level is loaded. The profiler shows that this happens in Application.Integrate Assets in Background.

Am I missing something here and is there a way I can eliminate this delay?

Comment
Add comment · Show 2
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 syclamoth · Jan 25, 2012 at 04:17 PM 0
Share

Try using Application.LoadLevelAsync. This should eli$$anonymous$$ate the lag.

avatar image WhiskeyJack · Jan 25, 2012 at 04:34 PM 0
Share

Thanks for the suggestion, but it didn't work. Ins$$anonymous$$d of one long freeze, I get a long sequence of shorter wait times (around 100ms, also in Application.Integrate Assets in Background) ending up with the same result.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by gilley033 · Mar 06, 2013 at 11:06 PM

There seems to be some discrepancy in the Unity docs regarding Asynchronous level loading. For instance, on the page for Application.LoadLevelAsync, it states:

"This allows you to load new levels while still playing the current one, show a progress bar or create a completely streaming world where you constantly load and unload different parts of the world based on the player position, without any hiccups in game play."

However, the docs then acknowledge that asynchronous loading can have an impact on game performance, or else the Application.backgroundLoadingProperty wouldn't exist.

So as far as I can tell, asynchronous loading will probably always have some impact on game performance.

The only thing you can try is changing the value for Application.backgroundLoadingPriority. Do this with the following code:

 Application.backgroundLoadingPriority = ThreadPriority.Low;

More information can be found here

Comment
Add comment · Share
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

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

6 People are following this question.

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

Related Questions

Why does U4 hang when trying to load an Asset Bundle scene? 0 Answers

AssetBundle.LoadAssetAsync case freezing in Unity5.5.0p1 5 Answers

Scene Asset Bundle - LoadLevelAdditive and OnLevelWasLoaded 1 Answer

LoadLevel + LoadLeveAsync = freeze? 1 Answer

RenderSettings in AssetBundles 3 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