Skip to content

fix: player objects do not honor the DontDestroyWithOwner property [MTT-4458] #2225

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

Merged

Conversation

NoelStephensUnity
Copy link
Collaborator

@NoelStephensUnity NoelStephensUnity commented Sep 29, 2022

When a client disconnects from the server the server will destroy their PlayerObject regardless of how DontDestroyWithOwner is set.

MTT-4458
#2138

Changelog

  • Fixed: The issue where player objects were not taking the DontDestroyWithOwner property into consideration when a client disconnected.

Testing and Documentation

  • Includes integration test.

This fixes the issue with player objects not honoring the DontDestroyWithOwner property.
MTT-4458
The summary for DontDestroyWithOwner was incorrect.  When true the NetworkObject's ownership is given back to the server.
MTT-4458
updating the changelog
Adding a test to verify that when a client disconnects and the client's player object has DontDestroyWithOwner set to true that the NetworkObject's ownership is transferred back to the client.
@NoelStephensUnity NoelStephensUnity marked this pull request as ready for review September 29, 2022 23:20
@NoelStephensUnity NoelStephensUnity requested a review from a team as a code owner September 29, 2022 23:20
@NoelStephensUnity NoelStephensUnity merged commit 14c26fe into develop Sep 30, 2022
@NoelStephensUnity NoelStephensUnity deleted the fix/dontdestroywithowner-on-playerobjects-mtt-4458 branch September 30, 2022 21:32
jakobbbb pushed a commit to GooseGirlGames/com.unity.netcode.gameobjects that referenced this pull request Feb 22, 2023
…TT-4458] (Unity-Technologies#2225)

* fix
This fixes the issue with player objects not honoring the DontDestroyWithOwner property.
The summary for DontDestroyWithOwner was incorrect.  When true the NetworkObject's ownership is given back to the server.

* test
Adding a test to verify that when a client disconnects and the client's player object has DontDestroyWithOwner set to true that the NetworkObject's ownership is transferred back to the client.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants