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
1
Question by Josh 4 · Jun 30, 2010 at 01:23 PM · loadloadlevelloadlevelasyncprogress-bar

Application.LoadLevelAsync() causes Unity crash?

I'm attempting to use Application.LoadLevelAsync() to load a level and it's causing Unity to crash about 50% of the time. I'm running the load level operation as a coroutine while running a progress bar type object as another coroutine. The level loading operation generates information that updates the progress bar. Has anyone else had a similar experience with Unity crashing when using LoadLevelAsync()?

Comment
Add comment · Show 4
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 MikezNesh · Jun 30, 2010 at 01:33 PM 0
Share

I haven't... there might be something wrong with the code. Why don't you show us the code so we can debug it.

avatar image Lucas Meijer 1 ♦♦ · Aug 02, 2010 at 06:35 PM 0
Share

We would love to see your project in a bugreport so we can fix the crash. (Use inunitymenu->Help->Report a problem). Thanks!

avatar image neonplaymark · Oct 03, 2011 at 11:13 AM 0
Share

I've come across the same behaviour. I have a GameObject which in it's Start() is attempting to GameObject.Find another object in the scene hierarchy (objects exist in the same scene at design time). However I am seeing that when the on occasions (>50%) that it fails to find the object. And when it fails, I print a dump off all the objects in scene, and notice that they are not all there. This happens on iOS.

avatar image mviuk · Oct 05, 2011 at 09:49 AM 0
Share

The issue turned out to be that one device was network instantiating an object before the other device had finished loading. Because we were loading with LoadLevelAsync, the wrong scene (our loading scene) recieved that object instantiation and because of the GameObject.Find looking for an object in the wrong scene it failed. This was resolved by turning off the message queue before loading and turning it back on after loading was complete ( Network.is$$anonymous$$essageQueueRunning = false; and Network.is$$anonymous$$essageQueueRunning = true; ). There's a great topic at http://unity3d.com/support/documentation/Components/net-NetworkLevelLoad.html

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Max Kaufmann · Aug 02, 2010 at 05:54 PM

Did you PushAssetDependencies() in your build script and forget to load dependent assets?

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
avatar image
0

Answer by neonplaymark · Oct 03, 2011 at 01:42 PM

I had this when a colleague changed the way some scripts worked. He made an object that existed in the scene into a prefab and then used a script to instantiate it. However we had a different script that attempted to GameObject.Find it. On iPhone, the scripts seemed to run in a different order and we only saw this during a LevelLoadAsync. And of course, GameObject.Find returns null if it does not find an object. And you'll get a nasty NullExeceptionError.

With Unity 3.4 you can fix this by setting the Script Execution Order (Edit->Project Settings->Script Execution Order). And make the script that instantiates object run before ones that use the instantiated object.

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

2 People are following this question.

avatar image avatar image

Related Questions

How to load levels with animation GUI 1 Answer

Preloading scene issue 0 Answers

UI Scene Loading Bar In Unity 5 C#? 1 Answer

Loading a level and waiting for an input. 1 Answer

Load music only when everything is loaded 1 Answer


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