Skip to content

Scene NetworkObjects get destroyed if the user starts and stops as host multiple times #1748

Closed
@PhiSel

Description

@PhiSel

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

  1. Create a new Scene
  2. Setup a NetworkManager with UNET-Transport
  3. Add a GameObject with a NetworkObject (Dont Destroy with Owner = true)
  4. Start Playmode
  5. Click "Start Host"
  6. Click "Stop Host"
  7. Click "Start Host"
  8. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions