You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Unity serialization exception from NetworkConnection constructor after upgrading to Mirror 96.11.3 #4130
After upgrading Mirror from 96.11.2 to 96.11.3, I began getting repeated Unity serialization exceptions involving NetworkConnection.
Downgrading to Mirror 96.11.2 eliminates the exceptions without any other code changes.
Environment
Unity: 6000.6.3f1
Mirror: 96.11.3
Last known working Mirror version: 96.11.2
Exception
UnityException: get_time is not allowed to be called during serialization, call it from Awake or Start instead. Called from MonoBehaviour 'NetworkIdentity' on game object 'Player'.
See "Script Serialization" page in the Unity Manual for further details.
Mirror.NetworkConnection..ctor () (at Assets/Mirror/Core/NetworkConnection.cs:65)
Mirror.NetworkConnectionToClient..ctor () (at Assets/Mirror/Core/NetworkConnectionToClient.cs:63)
UnityEngine.StackTraceUtility:ExtractStringFromExceptionInternal(Object, String&, String&)
Network prefab registration
One potentially relevant detail is that I do not maintain the network prefab list manually in the NetworkManager inspector.
My network prefabs are loaded as Addressables and registered programmatically using:
One thing I neglected to mention is that the network prefab registration occurs in the process of warming a cache of ScriptableObjects loaded via the Addressables system. Here are the relevant C# files... ConfigDefinition.cs ConfigRegistry.cs
Activity
lcompton commentedon Sep 28, 2026
One thing I neglected to mention is that the network prefab registration occurs in the process of warming a cache of ScriptableObjects loaded via the Addressables system. Here are the relevant C# files...
ConfigDefinition.cs
ConfigRegistry.cs
MrGadget1024 commentedon Sep 28, 2026
Which change in this commit do you think is the breaking change? Either add them individually from 11.2 or remove them from 11.3.
lcompton commentedon Sep 29, 2026
Adding "[Serializable]" to NetworkConnection and NetworkConnectionToClient in 96.11.2 caused the exceptions to appear. I stopped there.
MrGadget1024 commentedon Sep 30, 2026
Try 11.3 and change those to
[System.NonSerialized]instead and see if that works.lcompton commentedon Oct 1, 2026
"[NonSerialized]" can only be applied to fields. I tried putting "[NonSerialized]" on "lastMessageTime". That did not solve the problem.
MrGadget1024 commentedon Oct 1, 2026
Might just have to remove the attributes and live with the annoying warnings from Unity.
lcompton commentedon Oct 2, 2026
Perhaps there's an alternative to running Time.time in that constructor. Do those classes need to be Serializable?