Hello. The following problem has arisen. There is a host and a client in the lobby.
The host changes the scene. Goes to a new scene and it has an ItemSpawner, where it creates NO.Spawn(true) objects in OnNetworkSpawn. The client first receives the creation of objects, and then a scene change where the client destroys these created objects. The scene loads the host in the following way NetworkManager.Singleton.SceneManager.LoadScene(data.Scenes[0], LoadSceneMode.Single);
And in console i see next errors:
[Netcode] [Invalid Destroy][Wheel(Clone)][NetworkObjectId:14] Destroy a spawned NetworkObject on a non-host client is not valid. Call Destroy or Despawn on the server/host instead.
1 Like
Is the Wheel(Clone) in the former or the new scene?
Is the scene you were coming from also a scene loaded with NetworkManager’s SceneManager?
Do you call Destroy() anywhere, particularly where it might be run on the client?
Through the eyes of the client I see the following. First I see how objects (Wheels) are created in the lobby. And then transition to a new stage. Destroy and Despawn. Currently not used anywhere. The transition to a new scene is made by the host by calling NetworkManager.Singleton.SceneManager.LoadScene(data.Scenes[0], LoadSceneMode.Single);
Everyone connected to the lobby automatically starts loading the scene
Is there some kind of variable that silences threads and RPCs while loading?
the problem is not solved
2 Likes