Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Resolved The Networkobject is all removed after the client loads the scene

Discussion in 'Netcode for GameObjects' started by lettersama, Aug 22, 2023.

  1. lettersama

    lettersama

    Joined:
    Aug 17, 2022
    Posts:
    1
    After loading the scene, it prompts NotServerException: NotServerException: Destroy a spawned NetworkObject on a non-host client is not valid. Call Destroy or Despawn on the server/host instead.
    The host can receive Rpc from the Client, but all NetworkObjects in the Client port will be deleted.
    This problem didn't exist a few weeks ago, I just added the single player mode of the game in this time, and the problem has appeared since then.
    My english is only good enough for coding, hope these translated texts don't cause too much difficulty in understanding, sorry.
    Unity: 2021.3.26 Network code: 1.4.0

    When I switched to the 2022.3.0 version, the problem no longer happened. Although there were more warnings that seemed to have nothing to do with it, it was running normally...
     
    Last edited: Aug 22, 2023