diff --git a/Assets/Mirror/Runtime/NetworkIdentity.cs b/Assets/Mirror/Runtime/NetworkIdentity.cs index 7ee53308b..b98f69040 100644 --- a/Assets/Mirror/Runtime/NetworkIdentity.cs +++ b/Assets/Mirror/Runtime/NetworkIdentity.cs @@ -274,6 +274,9 @@ void AssignSceneID() bool duplicate = sceneIds.TryGetValue(m_SceneId, out existing) && existing != null && existing != this; if (m_SceneId == 0 || duplicate) { + // clear in any case, because it might have been a duplicate + m_SceneId = 0; + // if a scene was never opened and we are building it, then a // sceneId would be assigned to build but not saved in editor, // resulting in them getting out of sync.