Invalid Destroy Error in DA When Changing Scenes #3144
Labels
priority:high
This issue has high priority and we are focusing to resolve it
stat:Investigating
Issue is currently being investigated
type:bug
Bug Report
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:
![Image](https://private-user-images.githubusercontent.com/76796287/390595481-89e81da5-7073-4066-bda5-651544e1fa6c.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2NDQzMDcsIm5iZiI6MTczOTY0NDAwNywicGF0aCI6Ii83Njc5NjI4Ny8zOTA1OTU0ODEtODllODFkYTUtNzA3My00MDY2LWJkYTUtNjUxNTQ0ZTFmYTZjLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE1VDE4MjY0N1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWE0MDBjODU4YjFiYjViOTU0MTE5MzAyMDkxY2E4MThmN2I3YTZiMjE5MzQzZjk4MGFjYmE2Y2M1N2E4MjA5YjcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.Xp1_ItjhrL2Ama0rjdGDklI5Y4zgr12DYm7OtHOnw4U)
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: