Skip to content
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

fix: Do not propagate in-scene value to dynamically spawned children [MTT-5357] #2396

Conversation

NoelStephensUnity
Copy link
Collaborator

@NoelStephensUnity NoelStephensUnity commented Jan 26, 2023

This resolves a regression bug with the last parenting updates where a dynamically spawned NetworkObject that was parented under an in-scene placed NetworkObject would have its InScenePlaced value set to true causing a soft synchronization error on a late joining client side.

MTT-5357
Pertains to issue #2358

Changelog

  • Fixed: issue where a dynamically spawned NetworkObject parented under an in-scene placed NetworkObject would have its InScenePlaced value changed to true. This would result in a soft synchronization error for late joining clients.

Testing and Documentation

  • Includes integration test.

This resolves the issue with dynamically spawned NetworkObjects that are parented under an in-scene placed NetworkObject would be marked as in-scene placed and cause client-side soft synchronization issues due to the client looking for an in-scene placed NetworkObject that was actually dynamically spawned.
Added integration test to validate this fix.
This tests that both players and dynamically spawned NetworkObjects that are parented under in-scene placed NetworkObjects works and that late joining clients properly synchronize the parented status.
This also validates an advanced parenting sample in our documentation works.
MTT-5357
Adding the fix to the changelog.
@NoelStephensUnity NoelStephensUnity marked this pull request as ready for review January 26, 2023 19:24
@NoelStephensUnity NoelStephensUnity requested a review from a team as a code owner January 26, 2023 19:24
@@ -0,0 +1,61 @@
using UnityEngine.SceneManagement;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any chance there could be an automated test for this instead of only manual tests? Manual tests only catch things if someone remembers to run them.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are two tests in this PR:
Manual test: this script is used in that.
Integration Test: (see ObjectParenting/ParentDynamicUnderInScenePlaced.cs below)

They both accomplish the same thing, with the manual test being something you can visually confirm and make adjustments to in the event any future seemingly related issues are filed and need to be replicated/confirmed an issue (or debugged).

@NoelStephensUnity NoelStephensUnity merged commit 4a1c2ff into develop Feb 8, 2023
@NoelStephensUnity NoelStephensUnity deleted the fix/do-not-propagate-inscene-value-to-dynamically-spawned-children branch February 8, 2023 18:12
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.

None yet

3 participants