Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Bug 2022 crash after entering play mode from Prefab mode

Discussion in 'Editor & General Support' started by amroc, Jun 20, 2022.

  1. amroc


    Apr 8, 2014
    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 <unknown> <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.
    Fritsl likes this.
  2. amroc


    Apr 8, 2014
    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:

    Code (CSharp):
    1. #if UNITY_EDITOR
    2. using UnityEditor;
    3. using UnityEditor.SceneManagement;
    5. [InitializeOnLoad]
    6. public static class CrashFix_2022_1
    7. {
    8.     static CrashFix_2022_1()
    9.     {
    10.         EditorApplication.playModeStateChanged += OnPlayModeStateChanged;
    11.     }
    13.     private static void OnPlayModeStateChanged(PlayModeStateChange state)
    14.     {
    15.         if (state == PlayModeStateChange.ExitingEditMode)
    16.         {
    17.             StageUtility.GoToMainStage();
    18.         }
    19.     }
    20. }
    21. #endif
    Fritsl and mschweitzer-phx like this.