Search Unity

What is the reason of this error?

Discussion in 'Editor & General Support' started by Bagazi, Oct 28, 2019.

  1. Bagazi

    Bagazi

    Joined:
    Apr 18, 2018
    Posts:
    611
    Assertion failed on expression: 'm_CurrentHiddenGameObjects->find(gameObject.GetInstanceID()) == m_CurrentHiddenGameObjects->end()'
    upload_2019-10-28_11-10-56.png

    As described in error log, It is refers to "DontDestroyOnLoad" function. But I cannot find any helpful imformation about this . What is error mean?
     
    Delumine and _eternal like this.
  2. Dennooo

    Dennooo

    Joined:
    May 12, 2015
    Posts:
    88
    I'd be interested in the same. Happened to me after upgrading from Unity 2017.x to 2019.1. Still looking for a way to get rid of this.
     
    Shippety likes this.
  3. toriakai

    toriakai

    Joined:
    Dec 15, 2016
    Posts:
    4
    I had the same error. Seems to be linked to the fact that my object was hidden in the SceneVis tool. Error disappeared when I changes the visibility to show it again.
     
    Ulgrude, Delumine, Batskel and 7 others like this.
  4. Dennooo

    Dennooo

    Joined:
    May 12, 2015
    Posts:
    88
    Thanks! Problem solved after changing the object to visible.
     
  5. Bagazi

    Bagazi

    Joined:
    Apr 18, 2018
    Posts:
    611
    What is the SceneVis tool ? Is it some third-party tool?
     
  6. Valjuin

    Valjuin

    Joined:
    May 22, 2019
    Posts:
    481
    kongchanR, Bagazi and tarnumius like this.
  7. li18202213260

    li18202213260

    Joined:
    Aug 28, 2018
    Posts:
    1
    Thanks. I get it
     
  8. RoyBarina

    RoyBarina

    Joined:
    Jul 3, 2017
    Posts:
    98
    This works for me:
    Code (CSharp):
    1. private void Awake()
    2. {
    3. #if UNITY_EDITOR
    4.     if (Application.isPlaying)
    5.         UnityEditor.SceneVisibilityManager.instance.Show(gameObject, false);
    6. #endif
    7.     DontDestroyOnLoad(gameObject);
    8. }
     
    Bagazi and andrew_salveson like this.
  9. andrew_salveson

    andrew_salveson

    Joined:
    Apr 22, 2020
    Posts:
    7
    this fixed the problem for me! thank you
     
    RoyBarina likes this.
  10. adamgolden

    adamgolden

    Joined:
    Jun 17, 2019
    Posts:
    1,555
    The console was being spammed with this error for me as well every time I'd enter Play Mode. Deleting the Library folder then reopening the project solved it. 2022.2.0b3, Windows 10.
     
    Kokowolo and kana1939 like this.