-
Notifications
You must be signed in to change notification settings - Fork 449
Invalid Destroy Error in DA When Changing Scenes #3144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@KadaXuanwu Regarding the |
Thanks! Yes, I could see this feature save some time if you have to manually add a lot of NetworkObjects. |
Following up on this issue.
While scene migration synchronization seems like it would be associated with the
So, you can have both properties enabled or disabled and they should not impact each other. As an example:
Regarding the error message, looking into this issue as it should just despawn without an error message using the replication steps you outlined originally. |
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: