fix: serialize the scene placed field and fix DA scene migration#4086
Merged
NoelStephensUnity merged 21 commits intoJul 15, 2026
Merged
Conversation
- Adjusted the `InScenePlaced` property to internally set or publicly get the serialized `m_InScenePlaced` field. - `NetworkObject` now implements `ISerializationCallbackReceiver` to assure `m_InScenePlaced` is always properly set for in-scene placed objects. - Removed legacy define for UNITY_2021_2_OR_NEWER since v2.x.x+ is only for Unity v6.
NoelStephensUnity
marked this pull request as ready for review
July 14, 2026 17:03
- `ISerializationCallbackReceiver` implementation as that does not accomplish what we need. - Setting InScenePlaced within OnValidate instead.
Fixing several issues with NetworkObjectSceneMigrationTests. Fixing several formatting issues.
Issue where distributed authority would throw an exception during scene migration due to the fact that we would throw an exception if the 1st scene in the scene migration table didn't contain the client that has authority over the NetworkObject that migrated into a new scene. Now we count how many entries were written and if that count is zero upon parsing known loaded scenes then it throws an exception. Reverting the exclusion of DDOL synchronization (that was a red herring).
Removing the ValidateSceneOnAllClients portion as that doesn't assure that all clients have loaded the scene and fully synchronized the scene which could lead to edge case issues during this test.
NoelStephensUnity
changed the base branch from
develop-2.0.0
to
fix/in-scene-placed-edge-cases
July 15, 2026 22:54
NoelStephensUnity
merged commit Jul 15, 2026
bebbc3a
into
fix/in-scene-placed-edge-cases
6 checks passed
This was referenced Jul 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose of this PR
This fixes an edge case scenario where non-spawned NetworkObjects migrated into the DDOL during awake would not get spawned upon starting a session as a server, host, or session owner.
While getting some of the validation tests for this working, ran into the issue with MTT-15430 which required fixing that issue in order to get some of the newer and adjusted tests to work. So, this PR includes the fix for this too.
Jira ticket
Extension fixes for #4073
Also fixes MTT-15430
Changelog
Fixed: Issue where scene migration in a distributed authority session would throw an exception on clients migrating their owned
NetworkObjectinstances to a different scene.Fixed: Issue where migrating a dynamically spawned or in-scene placed
NetworkObjectinto a different scene during awake could result in that spawned instance to not be synchronized.Documentation
Testing & QA (How your changes can be verified during release Playtest)
Functional Testing
Manual testing :
Manual testing doneAutomated tests:
Covered by existing automated testsCovered by new automated testsNetworkSceneManagerStartupTestsand associated assets to testproject.Does the change require QA team to:
Review automated tests?Execute manual tests?Provide feedback about the PR?If any boxes above are checked the QA team will be automatically added as a PR reviewer.
Backports
Does not require a backport.