Skip to content

Commit a886226

Browse files
committed
Fixed missing host observer
1 parent d7b2dc4 commit a886226

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

MLAPI/MonoBehaviours/Core/NetworkingManager.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -568,8 +568,9 @@ public void StartHost(Vector3? pos = null, Quaternion? rot = null, int prefabId
568568
ConnectedClientsList.Add(ConnectedClients[hostClientId]);
569569

570570
prefabId = prefabId == -1 ? SpawnManager.GetNetworkedPrefabIndexOfName(NetworkConfig.PlayerPrefabName) : prefabId;
571-
SpawnManager.CreateSpawnedObject(prefabId, 0, hostClientId, true, NetworkSceneManager.CurrentActiveSceneIndex, false, false, pos.GetValueOrDefault(), rot.GetValueOrDefault(), true, null, false, 0, false);
572-
571+
NetworkedObject netObject = SpawnManager.CreateSpawnedObject(prefabId, 0, hostClientId, true, NetworkSceneManager.CurrentActiveSceneIndex, false, false, pos.GetValueOrDefault(), rot.GetValueOrDefault(), true, null, false, 0, false);
572+
netObject.observers.Add(hostClientId);
573+
573574
SpawnSceneObjects();
574575

575576
if (OnServerStarted != null)

0 commit comments

Comments
 (0)