-
Notifications
You must be signed in to change notification settings - Fork 449
DontDestroyWithOwner does not work #3472
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
Labels
Comments
@TjDMC, The issue with the back-to-back invocations of NetworkShow and ChangeOwnership followed by an error on the target client side and the Dont Destroy With Owner property not being honored upon a client disconnecting will both be resolved in v2.4.0. |
Closing as #3477 resolves this issue. |
EmandM
pushed a commit
that referenced
this issue
Jun 3, 2025
) Based on issue #3472, this PR resolves the issue where the `NetworkObject.DontDestroyWithOwner` was not being honored. <!-- Add short version of the JIRA ticket to the PR title (e.g. "feat: new shiny feature [MTT-123]") --> ## Changelog - Fixed: Issue where the `NetworkObject.DontDestroyWithOwner` was not being honored. ## Testing and Documentation - Includes integration test `NetworkObjectDontDestroyWithOwnerTests.NetworkShowThenClientDisconnects`. - No documentation changes or additions were necessary. <!-- Uncomment and mark items off with a * if this PR deprecates any API: ### Deprecated API - [ ] An `[Obsolete]` attribute was added along with a `(RemovedAfter yyyy-mm-dd)` entry. - [ ] An [api updater] was added. - [ ] Deprecation of the API is explained in the CHANGELOG. - [ ] The users can understand why this API was removed and what they should use instead. --> ## Backport The v1.x branch does no have this issue, but went ahead and backported the test in #3478. <!-- If this is a backport: - Add the following to the PR title: "\[Backport\] ..." . - Link to the original PR. If this needs a backport - state this here If a backport is not needed please provide the reason why. If the "Backports" section is not present it will lead to a CI test failure. -->
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Description
DontDestroyWithOwner = true
does not work withSpawnWithObservers = false
Reproduce Steps
Create a new scene.
Setup NetworkManager.
Attach the GameManager script to some object.
Create some sample NetworkObject.
Set the references of GameManager.
Build project.
In editor, press S to start server and spawn sample NetworkObject.
In built app, press C to start client.
In editor, press T to trigger change ownership.
In built app, press C to disconnect.
In editor, spawned NetworkObject is destroyed.
Actual Outcome
Network object is destroyed
Expected Outcome
Network object not destroyed
Environment
The text was updated successfully, but these errors were encountered: