Skip to content

Commit ee0e045

Browse files
fix
Send initial scenes loaded, then spawn in-scene placed NetworkObjects and then spawn in-scene placed and the local session owner player and then re-synch the session.
1 parent d4a6dcc commit ee0e045

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

com.unity.netcode.gameobjects/Runtime/Messaging/Messages/ConnectionApprovedMessage.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,9 @@ public void Handle(ref NetworkContext context)
237237

238238
if (!IsRestoredSession)
239239
{
240+
// Synchronize the service with the initial session owner's loaded scenes and spawned objects
241+
networkManager.SceneManager.SynchronizeNetworkObjects(NetworkManager.ServerClientId);
242+
240243
// Spawn any in-scene placed NetworkObjects
241244
networkManager.SpawnManager.ServerSpawnSceneObjectsOnStartSweep();
242245

0 commit comments

Comments
 (0)