[HOWTOI] Handle "Assertion failed on expression" message in Unity editor
Posted: Sun Oct 16, 2022 9:12 am
In some Unity versions, under certain circumstances you may see this message in the Console window when entering play mode:
Assertion failed on expression: 'm_GameObjects.find(gameObject.GetInstanceID()) == m_GameObjects.end()'
This is a harmless bug in Unity related to scene object visibility. This typically happens if you've set the Dialogue Manager GameObject to be invisible in the Scene view:
When the Dialogue Manager GameObject starts, it moves from the active scene in the hierarchy to a temporary runtime "scene" named "DontDestroyOnLoad". The Scene view doesn't immediately update its list of which GameObjects are in each scene, so it reports this message. However, all GameObjects are in the proper place, so there's no issue.
Assertion failed on expression: 'm_GameObjects.find(gameObject.GetInstanceID()) == m_GameObjects.end()'
This is a harmless bug in Unity related to scene object visibility. This typically happens if you've set the Dialogue Manager GameObject to be invisible in the Scene view:
When the Dialogue Manager GameObject starts, it moves from the active scene in the hierarchy to a temporary runtime "scene" named "DontDestroyOnLoad". The Scene view doesn't immediately update its list of which GameObjects are in each scene, so it reports this message. However, all GameObjects are in the proper place, so there's no issue.