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 grimmy · Jan 03, 2013 at 11:40 AM · editorscenecrashasset bundle

How can I stop my editor from crashing everytime it loads a new Scene during runtime? (since Unity 4)

**strong text**My game was completely fine before installing Unity4 but now I get a crash to desktop 100% of the time when running the game in the editor.

I have found that the problem lies at the point of the game attempting to load an asset bundled scene.Once the bundle has successfully downloaded I try to load it. The game then crashes at the Application.LoadLevel command.

  if(Application.CanStreamedLevelBeLoaded(sceneName))
 {
     print("this prints");
     Application.LoadLevel(sceneName);//CRASH HERE
     print("this doesnt print..its already crashed to desktop")
 }

To note:

  • Other asset bundles (not scenes) have been loaded fine before this code executes.

  • I have Unity Pro

  • The scene exists at the correct path (double checked)

  • No code was modified ..the only change was to upgrade to Unity 4. It worked fine before the upgrade.

  • I have already re installed Unity 4/Rebooted many times & Cleaned the registry & even updated my GFX drivers!

  • I have tried LoadLevelAsync but this also results in the same crash.

  • I have tried re-bundling the scene using Unity 4.(Didn't work)

- EDIT: If I load a blank scene it works!...but if I load the scene I want with ALL Game Objects deactivated it still crashes.(Shouldn't this do exactly the same as a blank scene??)

In the editor log the crash seems to occur at:

 m_ThreadCheck && Thread::mainThreadId && !Thread::CurrentThreadIsMainThread()
 
 (Filename: C:/BuildAgent/work/812c4f5049264fad/Runtime/Utilities/MemoryPool.cpp Line: 117)
     
 Crash!!!
 SymInit: Symbol-SearchPath: 'C:/Program Files (x86)/Unity/Editor/Data/MonoEmbedRuntime;.

It happens 100% of the time!

I tested it with a couple of different scsnes and it doesn't seem to matter which one I try to load, it always crashes here.

Any help would be gratefully received! Thanks!

Eek!

Comment
Add comment · Show 5
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 Lovrenc · Jan 03, 2013 at 12:05 PM 0
Share

Do you get any "update warnings" when you open unity editor? (eg. install windows update 5122145... for stability)

avatar image grimmy · Jan 03, 2013 at 12:13 PM 0
Share

No warnings. Unity boots up nicely.

avatar image grimmy · Jan 03, 2013 at 11:25 PM 0
Share

oh...I've just tried re bundling the scenes using Unity 4 (the previous ones were built with Unity 3)....but it didn't make a blind bit of difference. It still crashes really well.

avatar image Caiuse · Jan 04, 2013 at 10:15 AM 0
Share

Were the asset bundles built in Unity3? I would rebuild the bundles in Unity4 and try again. I may just be repeating you last comment, apologies if I am.

avatar image grimmy · Jan 04, 2013 at 10:16 AM 0
Share

Yeah, I tried that. It didn't work :( Cheers

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Bunny83 · Jan 04, 2013 at 01:28 PM

That means you have some code on an asset in this scene which causes the crash. It looks like you used the unity api in a class constructor or field initializer. Those are executed from a different thread. I would recommend to backup the whole project and start removing your scripts from all objects (one by one) to see which one causes the error.

There's not much we can do with that little information.

Comment
Add comment · Show 7 · 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 grimmy · Jan 04, 2013 at 01:35 PM 0
Share

I disabled all objects in the scene but I still get the crash though. Is this the expected behavior even with your solution? Do I actually need to start deleting scripts?

avatar image Bunny83 · Jan 04, 2013 at 01:41 PM 0
Share

Disabling doesn't help. The objects are still created and deserialized. Your fault is in a class constructor or a field initializer.

avatar image grimmy · Jan 04, 2013 at 01:53 PM 0
Share

Okay cool. And do you think that this kind of thing is likely to have happened because of the upgrade to Unity 4? And if so, why did it work in Unity 3.5? :)

avatar image whydoidoit · Jan 04, 2013 at 02:00 PM 2
Share

It's likely that something in a field initializer or class constructor is attempting to access a game object or script and this isn't happening from the main thread (these things should be done in Awake) - causing the crash. It's odd that you didn't get a warning (or non-fatal error) before.

avatar image grimmy · Jan 04, 2013 at 04:07 PM 2
Share

Through random trial and error, I just tried removing every object in the scene that had a font (any font) and amazingly, the scene ran! I added a brand new object GUIText to the scene with the default Arial font and the scene started crashing again. I then tried an empty scene with 'just' a guiText and this also failed. So it looks like Its to do with fonts (maybe)...but it also looks like I cant use any fonts ever again. ?!?!

Show more comments
avatar image
0

Answer by grimmy · Jan 04, 2013 at 04:31 PM

In order to get the scene to load I had to delete every object from the scene which had font (seemingly).

For some reason if I add any objects (such as a default GUIText) the level load attempt will crash to desktop.

My initial scene contains fonts but is not streamed from an asset bundle.

I am now at the point where I cant load/run any scene containing fonts downloaded as asset bundles...which effectively ruins the game my team have been working hard on for the last two years.

MASSIVE ROADBLOCK HERE!

Where to next? Help!?! The only option I can see is to roll back to 3.5.

Cheers P.S> At this point in time I'm thinking 'That was £1400 well spent...NOT!'..

Comment
Add comment · Show 11 · 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 Lovrenc · Jan 04, 2013 at 04:33 PM 0
Share

Why would you change developing environment after 2 years? Just curious i never was in any big project or anything.

avatar image grimmy · Jan 04, 2013 at 04:37 PM 0
Share

I didn't. I just updated from Unity 3.5 to Unity 4.

avatar image grimmy · Jan 04, 2013 at 05:16 PM 0
Share

I have reported this to unity and attached this portion of the game that crashes 100% of the time...

avatar image MibZ · Jan 04, 2013 at 09:28 PM 0
Share

Well if you've been developing it for 2 years you have to have backups from before you upgraded, try reinstalling the last version you used and testing the build just before you upgraded.

Then when you're sure the issue is isolated to 4 try reinstalling it and converting it again. Sometimes things are nonsensically goofy like that, happened to me.

avatar image grimmy · Jan 05, 2013 at 06:02 AM 0
Share

I tried re-installing Unity 4 many times. I have backups which run fine in Unity 3.5. Yes, I can continue to work using 3.5 but that doesn't help me going forward. Cheers.

Show more comments

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

13 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

Related Questions

Editor Crash: Where is Scene Data kept? 3 Answers

Why am I losing all scene data when loading an Asset Bundle-loaded scene? 0 Answers

Scene Variable Serialization issues on crash, save etc. 1 Answer

Editing Animations crashes Unity 1 Answer

Object Painter Editor Help 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