From ea87561b52f45c8bf68aa39a05b7c468bab4ea81 Mon Sep 17 00:00:00 2001 From: vis2k Date: Tue, 31 Dec 2019 15:57:25 +0100 Subject: [PATCH] respawn objects after loading scene --- Assets/Mirror/Runtime/NetworkManager.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Assets/Mirror/Runtime/NetworkManager.cs b/Assets/Mirror/Runtime/NetworkManager.cs index 535b7d6da..9130922ea 100644 --- a/Assets/Mirror/Runtime/NetworkManager.cs +++ b/Assets/Mirror/Runtime/NetworkManager.cs @@ -753,6 +753,10 @@ public virtual void ServerChangeScene(string newSceneName) startPositionIndex = 0; startPositions.Clear(); + + // always need to respawn server objects after changing scene. + // previously this was done in OnSceneLoaded. + NetworkServer.SpawnObjects(); } internal void ClientChangeScene(string newSceneName, SceneOperation sceneOperation = SceneOperation.Normal, bool customHandling = false)