2018.2.0 - macos editor scene loading crash

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

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?

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 =/

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.

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.

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.

1 Like

could you report these 4 objects (if they are from a specific Asset might help me find it easy :slight_smile:

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.

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

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.

3 Likes

oh god. Thanks for the finding, well, hours of work should be put on this now :slight_smile:

This may be of help as well :wink:

[MenuItem("Utilities/Find Legacy Particle Components")]
public static void FindLegacyParticleComponents()
{
    var sb = new System.Text.StringBuilder();
    sb.AppendLine("GameObjects with particle renders:");

    foreach(var go in Selection.gameObjects)
    {
        var pr = go.GetComponent<ParticleRenderer>();
        if(pr)
            sb.AppendLine("  " + go.name);
    }

    Debug.Log(sb.ToString());
}

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 :wink:
I would recommend doing a backup first though.

1 Like

hah I just logged in again to post the same link to you :slight_smile: good luck to both of us then hah

1 Like

btw, enabling the legacy particles from package manager seems to fix the problem for me, will test more

1 Like

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

Yeap, not gonna bother till 2018.3 that legacy particles completely removed. Thank you too for the co-operation

1 Like

Thank you so much for your findings ZDestructor. I would never have figured it out.

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 ( Legacy Particle System Updater ) 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.

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.

This worked for me also. Directions:
Window.Package Manager. All. Built In Packages. Particles Legacy. Enable.