You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Distributed Authority (DA) topology, when I spawn objects using NetworkObject.Spawn(destroyWithScene: true), then change scene as SessionOwner using NetworkManager.SceneManager.LoadScene("Lobby", LoadSceneMode.Single), the network objects owned by the clients are correctly destroyed, but the SessionOwner receives an error: Destroy a spawned NetworkObject on a non-owner client is not valid during a distributed authority session.
Additionally, unchecking Scene Migration Synchronization on the NetworkObject was required, even though in my opinion it should be irrelevant when destroyWithScene: true is set.
Reproduce Steps
Set up a multiplayer game using Netcode for GameObjects (NGO) with Distributed Authority topology.
In a game scene, let clients spawn their own network objects with destroyWithScene: true.
Have the session owner call NetworkManager.SceneManager.LoadScene("Lobby", LoadSceneMode.Single).
Observe the session owner's console output.
Actual Outcome
Network objects are destroyed as expected.
The session owner receives an error
Expected Outcome
Network objects should be destroyed without errors since destroyWithScene: true was explicitly set.
in my opinion, Scene Migration Synchronization should not require manual disabling in this context.
As far as I know, the player object has to be destroyed by each client manually, where as other spawned network objects should be destroyed automatically on scene change if destroyWithScene: true. Please correct me if I'm wrong.
The text was updated successfully, but these errors were encountered:
@KadaXuanwu
You make some very good points and I finally have some time later this week to setup a replication project to run through some of the issues you are describing.
Regarding the Scene Migration Synchronization, we are doing a quality pass and I am looking at the possibility of expanding the Netcode for GameObjects Project Settings to include some additional global default settings for things like NetworkObject and such where you would be able to define what default values you want when creating new component instances.
Description
In Distributed Authority (DA) topology, when I spawn objects using
NetworkObject.Spawn(destroyWithScene: true)
, then change scene as SessionOwner usingNetworkManager.SceneManager.LoadScene("Lobby", LoadSceneMode.Single)
, the network objects owned by the clients are correctly destroyed, but the SessionOwner receives an error:Destroy a spawned NetworkObject on a non-owner client is not valid during a distributed authority session.
Additionally, unchecking Scene Migration Synchronization on the NetworkObject was required, even though in my opinion it should be irrelevant when
destroyWithScene: true
is set.Reproduce Steps
destroyWithScene: true
.NetworkManager.SceneManager.LoadScene("Lobby", LoadSceneMode.Single)
.Actual Outcome
Expected Outcome
destroyWithScene: true
was explicitly set.Screenshots
NetworkObject on an object owned by a client:
Environment
Additional Context
As far as I know, the player object has to be destroyed by each client manually, where as other spawned network objects should be destroyed automatically on scene change if
destroyWithScene: true
. Please correct me if I'm wrong.The text was updated successfully, but these errors were encountered: