NetworkManager can be destroyed on StopHost/StopClient (MoveGameObjectToScene causes destruction)
**Describe the bug**
A DDOL NetworkRoomManager can be destroyed when calling StopHost / StopClient. Mirror moves the DDOL manager into the active scene (SceneManager.MoveGameObjectToScene) during shutdown, then loads the offline scene. That move + scene load can destroy the persistent manager.
**[IMPORTANT] How can we reproduce the issue, step by step:**
Please tell us how to reproduce your issue, STEP BY STEP, with one of our built in examples.
1. Create a loader/bootstrap scene with a NetworkRoomManager
2. In the inspector: check "Don't Destroy On Load" and assign Offline scene to a menu scene like MainMenu. Assign OnlineScene to some lobby scene and assign RoomScene to same scene as OnlineScene,
3. Play by calling NetworkManager.singleton.StartHost())
4. While in lobby/room as host, leave by calling NetworkManager.singleton.StopHost()
5. When loaded back into offline scene now, NetworkManager should no longer exist under Do not destroy on load
**Expected behavior**
A DDOL NetworkManager should survive StopHost/StopClient and the offline scene load.
**Screenshots**
<img width="1146" height="111" alt="Image" src="https://github.com/user-attachments/assets/6c30e41f-079b-4e13-b1bf-d8c39a6965bf" />
NetworkManager.cs
**Desktop (please complete the following information):**
* OS: Windows
* Build target: Standalone
* Unity version: 6.3
* Mirror branch: Not sure which branch but it says mirror version 96.0.1 in assets
**Additional context**
Add any other context about the problem here.
关闭于 2026-03-16 1 条评论