[HOWTOI] Handle "Assertion failed on expression" message in Unity editor

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
User avatar
Tony Li
Posts: 20708
Joined: Thu Jul 18, 2013 1:27 pm

[HOWTOI] Handle "Assertion failed on expression" message in Unity editor

Post by Tony Li »

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:

unitySceneViewBugDialogueManager.png
unitySceneViewBugDialogueManager.png (14.94 KiB) Viewed 3961 times

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.
Post Reply