Closed
Description
Bug Description
In a context of lobbies where users can spawn lobbies, connect to other lobbies and leave them, NetworkObjects in the scene get destroyed if client is shutdown twice.
Reproduction steps
- Create a new Scene
- Setup a NetworkManager with UNET-Transport
- Add a GameObject with a NetworkObject (Dont Destroy with Owner = true)
- Start Playmode
- Click "Start Host"
- Click "Stop Host"
- Click "Start Host"
- Click "Stop Host"
Actual outcome
The GameObject with the NetworkObject gets destroyed.
Expected outcome
The GameObject stays in the scene after shutdown.
Environment
- OS: Windows 10
- Unity Version: 2020.3
- Netcode Version: 1.0.0-pre.5
Additional observations
At the first "Start Host", the NetworkObject is owned by the server and labeled as "IsSceneObject = true".
At the second "Start Host", the NetworkObject asks to be spawned (Spawn-Button in the inspector). If the button is clicked, the NetworkObject is owned by the server but labeled as "IsSceneObject = false"
Maybe this bug is related to this bug report: #1670