Skip to content

Commit c7ca276

Browse files
fix
This includes a fix for the forum reported issue where spawning with ownership in a distributed authority topology where the owner is not the spawn authority, the owner/authority sets a NetworkVariable during OnNetworkSpawn, then the changes made would not be synchronized.
1 parent 971d4ff commit c7ca276

File tree

1 file changed

+0
-11
lines changed

1 file changed

+0
-11
lines changed

com.unity.netcode.gameobjects/Runtime/Core/NetworkBehaviour.cs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -797,17 +797,6 @@ internal void InternalOnNetworkSpawn()
797797
{
798798
Debug.LogException(e);
799799
}
800-
801-
// Initialize again in case the user's OnNetworkSpawn changed something
802-
InitializeVariables();
803-
804-
if (m_NetworkObject.HasAuthority)
805-
{
806-
// Since we just spawned the object and since user code might have modified their NetworkVariable, esp.
807-
// NetworkList, we need to mark the object as free of updates.
808-
// This should happen for all objects on the machine triggering the spawn.
809-
PostNetworkVariableWrite(true);
810-
}
811800
}
812801

813802
internal void NetworkPostSpawn()

0 commit comments

Comments
 (0)