Skip to content

fix: #4131 mark NetworkIdentity._connectionToClient NonSerialized - #4133

Merged
miwarnec merged 1 commit into
MirrorNetworking:masterfrom
armadavalor:fix/4131-time-during-serialization
Nov 6, 2026
Merged

miwarnec merged 1 commit into
MirrorNetworking:masterfrom
armadavalor:fix/4131-time-during-serialization

Conversation

@armadavalor

Copy link
Copy Markdown
Contributor

NetworkIdentity._connectionToClient is a private field of a [Serializable] type. On domain reload Unity backs up and restores such fields, which constructs a NetworkConnectionToClient through its parameterless constructor. That chains into NetworkConnection(), which reads Time.time, and Unity throws "get_time is not allowed to be called during serialization".

The field is runtime-only state, so it is now marked [NonSerialized]. This is the fix suggested in the issue.

I could not run this in the Unity editor; the change is the single attribute.

Closes #4131

@miwarnec
miwarnec merged commit 1bac8ff into MirrorNetworking:master Nov 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UnityException "get_time is not allowed to be called during serialization" from NetworkIdentity._connectionToClient on domain reload (Unity 6.3)

2 participants