Description
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:
NetworkClient.RegisterPrefab(networkIdentity.gameObject);
This worked without the serialization exceptions under Mirror 96.11.2.
Reproduction / regression
I believe the following steps will reproduce the issue, although I haven't verified...
- Create a project using Unity 6000.6.3f1.
- Install Mirror 96.11.3.
- Create a prefab with a NetworkIdentity.
- Create a script that registers the prefab with
NetworkClient.RegisterPrefab().
get_time is not allowed to be called during serialization exception occurs.
Description
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
Exception
Network prefab registration
One potentially relevant detail is that I do not maintain the network prefab list manually in the
NetworkManagerinspector.My network prefabs are loaded as Addressables and registered programmatically using:
This worked without the serialization exceptions under Mirror 96.11.2.
Reproduction / regression
I believe the following steps will reproduce the issue, although I haven't verified...
NetworkClient.RegisterPrefab().get_time is not allowed to be called during serializationexception occurs.