2022 crash after entering play mode from Prefab mode

Since 2022 was released I have been trying to upgrade my 2021 project but I have this crash that happens every time, and only in Unity 2022. This isn’t related to my project/packages as it is reproducable with a clean project demonstrated here when following these specific steps:

  • While not playing, enter prefab mode for any prefab
  • Alter the prefab in some way
  • Start play mode still from within prefab mode
  • Alter the value of anything in the scene from the inspector
  • Close play mode and select anything from your project

This always results in a crash for me, with the following reported in the Editor.log:

=================================================================
Native Crash Reporting

Got a UNKNOWN while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.

=================================================================
Managed Stacktrace:

at <0xffffffff>
C:\Windows\SYSTEM32\SSPICLI.DLL:SSPICLI.DLL (00007FFB425B0000), size: 204800 (result: 0), SymType: ‘-deferred-’, PDB: ‘’, fileVersion: 10.0.19041.1586
at UnityEditor.Selection:set_instanceIDs <0x000e0>

I have filed a bug report, but would any of you mind please attempting to reproduce this? Just wondering if it’s related to my system in any way. As I mentioned this happens for any release version of 2022 (I have tried the most recent, 2022.1.5f1), and does not happen in 2021. Cheers.

1 Like

It seems this is fixed in the 2022.2 alpha, but still present in 2022.1. For anyone experiencing this problem, I have a simple workaround in the form of a small script that just exits prefab mode when you press play:

#if UNITY_EDITOR
using UnityEditor;
using UnityEditor.SceneManagement;

[InitializeOnLoad]
public static class CrashFix_2022_1
{
    static CrashFix_2022_1()
    {
        EditorApplication.playModeStateChanged += OnPlayModeStateChanged;
    }

    private static void OnPlayModeStateChanged(PlayModeStateChange state)
    {
        if (state == PlayModeStateChange.ExitingEditMode)
        {
            StageUtility.GoToMainStage();
        }
    }
}
#endif
2 Likes