Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

2018.2.0 - macos editor scene loading crash

Discussion in 'Editor & General Support' started by Deleted User, Jul 21, 2018.

  1. Deleted User

    Deleted User

    Guest

    Is anyone else getting crashes when trying to switch scenes in 2018.2.0?

    The stack trace of the crash doesn't point at my code.

    Sometimes, I'll see a wall of "object already loaded" or "mInstanceID != instance id" errors in the console right before the crash.

    Any ideas?

    Thanks


     
    Last edited by a moderator: Jul 21, 2018
  2. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,588
    Nope, works in the windows editor and windows standalone player for me without problems.

    If you're able to reproduce this issue, could you please submit a bug-report?
    https://unity3d.com/unity/qa/bug-reporting
     
  3. Deleted User

    Deleted User

    Guest

    I'm having a hard time narrowing it down. Switching to an empty scene doesn't crash. I've tried progressively deleting things, and the crashes slowly become intermittent, and eventually stop, but I can't really find any single object in the scene to blame. All the cross-references in my scene causing null reference exceptions aren't helping either =/
     
  4. SSL7

    SSL7

    Joined:
    Mar 23, 2016
    Posts:
    347
    Yeap having the exact same issue on Windows, crashing when changing scenes (going from main menu->new game), but plays fine in the main scene when running it from editor.
     
    Last edited: Jul 22, 2018
  5. Deleted User

    Deleted User

    Guest

    I wasn't able to find any one object causing this.

    After loading the scene, it sometimes doesn't crash right away (it crashes when exiting play mode instead), and I can look at the console. The console is flooded with "Object already loaded" errors (no stack trace). The error count on the console says 999+ and there are only ~700 GameObjects in the scene. I get a handful of "Object already loaded" errors that have stack traces (3 or 4), but they point at a line that adds an AudioSource to a GameObject, which should be totally fine.

    No idea what to do at this point.
     
  6. Deleted User

    Deleted User

    Guest

    I finally narrowed it down to 4 objects in my scene that seem to trigger the problem. I'm still confused because the four objects, which all crash the editor on their own, don't really have anything in common.

    Anyways, the bug report has been submitted.
     
    Peter77 likes this.
  7. SSL7

    SSL7

    Joined:
    Mar 23, 2016
    Posts:
    347
    could you report these 4 objects (if they are from a specific Asset might help me find it easy :)
     
  8. Deleted User

    Deleted User

    Guest

    Sorry, I don't understand what you're asking.

    The 4 objects in my scene don't seem to have any commonality. They're just textured models with a simple 10-20 line script on two of them. Two of them have legacy particle components on them, which I thought may have something to do with the crashes, but the other 2 do not, and still crash, even in an empty scene on their own.

    Sometimes, the project doesn't crash immediately, and only crashes after exiting/entering play mode a few more times. When it doesn't crash, the console is flooded with the following errors, which are pretty useless for the purpose of trying to come up with a workaround.

    *edit*
    At this point, I've stripped the scene down to the point where it's basically empty. There is one GameObject with no components on it, and a Camera with default settings. Switching into this scene causes a crash.
     
    Last edited by a moderator: Jul 23, 2018
  9. SSL7

    SSL7

    Joined:
    Mar 23, 2016
    Posts:
    347
    after your post I started doing the same, stripping down the scene, and I have the EXACT same issue, crashing while entering the screen or while pressing stop at play mode. weird stuff :S

    edit: yeap seems like I get same errors when it's not crashing
     
    Last edited: Jul 23, 2018
  10. Deleted User

    Deleted User

    Guest

    Well, I've figured it out.

    It is the legacy particle systems, but it's not just including them in the scene that causes a crash. It's having absolutely any indirect reference to them whatsoever that can cause the crash.

    For example, I had a prefab with a legacy particle system on it, and I deleted the legacy particle system components from the object in the scene, but the scene still crashed due to the fact that prefabs work in terms of modifications, and the original/source prefab still had the legacy particle system on it. Once I replaced the legacy particle system with the new one and applied the changes, the object no longer caused a crash.

    The other two objects had no legacy particle systems on them, but the scripts referenced prefabs that did. So once I updated the particle systems on the referenced prefabs, those two stopped crashing as well.

    I guess at this point I just have to go through every single prefab in the project and make sure that 100% of the legacy particle systems have been removed.
     
    itsnottme, drawcode and Peter77 like this.
  11. SSL7

    SSL7

    Joined:
    Mar 23, 2016
    Posts:
    347
    oh god. Thanks for the finding, well, hours of work should be put on this now :)
     
  12. Deleted User

    Deleted User

    Guest

    This may be of help as well ;)

    Code (CSharp):
    1. [MenuItem("Utilities/Find Legacy Particle Components")]
    2. public static void FindLegacyParticleComponents()
    3. {
    4.     var sb = new System.Text.StringBuilder();
    5.     sb.AppendLine("GameObjects with particle renders:");
    6.  
    7.     foreach(var go in Selection.gameObjects)
    8.     {
    9.         var pr = go.GetComponent<ParticleRenderer>();
    10.         if(pr)
    11.             sb.AppendLine("  " + go.name);
    12.     }
    13.  
    14.     Debug.Log(sb.ToString());
    15. }
    You can type "t: prefab" into the search field of the project panel, select the results, and run the function above to print the names of all the objects.

    If you're feeling brave, you can invoke the legacy particle system updater directly from the above function ;)
    I would recommend doing a backup first though.

    https://forum.unity.com/threads/release-legacy-particle-system-updater.510879/
     
    Last edited by a moderator: Jul 23, 2018
    drawcode likes this.
  13. SSL7

    SSL7

    Joined:
    Mar 23, 2016
    Posts:
    347
    hah I just logged in again to post the same link to you :) good luck to both of us then hah
     
    Deleted User likes this.
  14. SSL7

    SSL7

    Joined:
    Mar 23, 2016
    Posts:
    347
    btw, enabling the legacy particles from package manager seems to fix the problem for me, will test more
     
    itsnottme likes this.
  15. Deleted User

    Deleted User

    Guest

    Nice - that seems to have fixed it.
    The particle updater isn't producing correct results for some of my smoke/steam effects, so this is good news.

    Thanks
     
  16. SSL7

    SSL7

    Joined:
    Mar 23, 2016
    Posts:
    347
    Yeap, not gonna bother till 2018.3 that legacy particles completely removed. Thank you too for the co-operation
     
    Deleted User likes this.
  17. Damjan-Mozetic

    Damjan-Mozetic

    Joined:
    Aug 15, 2013
    Posts:
    46
    Thank you so much for your findings ZDestructor. I would never have figured it out.
     
  18. drawcode

    drawcode

    Joined:
    Jul 21, 2008
    Posts:
    72
    Second the thanks @ZDesctructor.

    I opened up an old racing game and upgraded it to 2018.2.3 that I didn't know had a ParticleEmitter on a disabled prefab from a test asset area on the wheel smoke. Unity just hard crashed on scene change instead of any info in the logs and it was not updated during upgrade process and had no warnings on the issue which was related to the full removal of the Legacy Particle System.

    Unity needs to do better on hard deprecation and removals of commonly used legacy features.

    Unity did offer tools like this in the forums (https://forum.unity.com/threads/release-legacy-particle-system-updater.510879/) which is nice, but it should be part of the upgrade process.

    Unity should also check for hard deprecated and removed features at
    • Unity open
    • scene open
    • upgrade process
    • and AT LEAST clearly specified in the logs if crashes.
    The logs that said "Failed to erase object from ms_TypeToObjectSet. It was not part of the set" it would have been nice to know what "It" is.

    The legacy particle system is in tons of old assets and projects and for the editor just to crash on scene change with zero information on it being due to the legacy particle system (ParticleEmitter etc) is not acceptable.

    The logs on the crash were not helpful and looked like this in case anyone else has this issue:

    and

    and


    In case anyone else falls into this pit of despair, just know that you need to remove the Legacy Particle System that was removed from Unity fully in 2018.2.3

    However Unity does not currently do well with removals of features, they need to improve especially on the logs. Currently there are not good checks on users upgrading and randomly getting the issue on run or scene change that had any ParticleEmitters or other legacy particle components. A hard crash should be more clear that is was a minor issue of the Legacy Particle System being present at all and to remove it.

    There is nothing worse than an editor crash, no info on it, and vague logs, it seems lazy and rushed the removal of this legacy component. Easily burned hours and probably many will have this issue on upgrades of older games to latest.

    Hopefully they will do better in future deprecation removals of common features especially. Sucks to lose hours to something that should have been clear at least in the logs.
     
    Last edited: Aug 12, 2018
  19. ryandailey21

    ryandailey21

    Joined:
    May 23, 2017
    Posts:
    2
    I'm having this issue too. It crashes when switching scenes at runtime. But it only does it with a specific prefab is in the scene. I've tried debugging my code, and I think it seemed to crash whenever the AddComponent<>() statement was used. But after removing those statements, it seems to crash in other areas as well though I cannot find why.
     
  20. FS9606

    FS9606

    Joined:
    Mar 12, 2015
    Posts:
    21
    This worked for me also. Directions:
    Window.Package Manager. All. Built In Packages. Particles Legacy. Enable.
     
  21. realgamingart

    realgamingart

    Joined:
    Apr 10, 2014
    Posts:
    20
    btw, enabling the legacy particles from package manager seems to fix the problem for me, will test more. This is right. Its also work for me too. Now my game is not getting crash.Thank you.