Skip to content

fix: In-Scene Placed Object Parenting, Serialization Order, and Transform Parent Detection #3387

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 Apr 8, 2025

This resolves issues with in-scene placed NetworkObject parenting where the original parent has changed. This resolves the issue where loading a scene would not order the serialization of loaded in-scene placed NetworkObjects based on their parent-child hierarchy.

This also resolves an issue where a NetworkTransform would think it was parented if nested under anything as well as removes the spamming error message when parenting a NetworkObject with NetworkTransform and using local space for synchronization (can be handled in documentation as to why this is a bad idea but there may be edge cases where a user might want to do this anyway).

MTT-11883

Changelog

  • Fixed: Issue where in-scene placed NetworkObjects could fail to synchronize its transform properly (especially without a NetworkTransform) if their parenting changes from the default when the scene is loaded and if the same scene remains loaded between network sessions while the parenting is completely different from the original hierarchy.
  • Changed: The scene loading event serialization order for in-scene placed NetworkObjects to be based on their parent-child hierarchy.
  • Changed: Removing the error message when a NetworkObject with NetworkTransform is parented and placed in local space when using rigidbody for motion.

Testing and Documentation

  • Includes no additional tests (requires manual testing due to scene loading constraints).
  • No documentation changes or additions were necessary.

This resolves issues with in-scene placed NetworkObject parenting where the original parent has changed.
This resolves the issue where loading a scene would not order the serialization of loaded in-scene placed NetworkObjects based on their parent-child hierarchy.
Removing the spam error message about parenting and using local space when using rigidbody for motion. This can be a documentation thing and there may be certain scenarios where one might want to do this anyway.
Cleaned up two areas for in-scene placed NetworkObject parenting after having a good paired programming session with Emma.
Fixing minor logic issue and removing local removeParent  var.
updating a comment to better reflect the changes.
@NoelStephensUnity NoelStephensUnity marked this pull request as ready for review April 9, 2025 15:33
@NoelStephensUnity NoelStephensUnity requested a review from a team as a code owner April 9, 2025 15:33
Adding change log entries.
fixing grammar issue with changelog entry.
argg...now for real the grammar is correct and that changed entry is more concise.
@NoelStephensUnity NoelStephensUnity added the port:1.x-completed This issue was ported to 1.X branch label Apr 9, 2025
@NoelStephensUnity NoelStephensUnity merged commit 23eab5d into develop-2.0.0 Apr 9, 2025
27 checks passed
@NoelStephensUnity NoelStephensUnity deleted the fix/in-scene-placed-network-object-parenting branch April 9, 2025 22:22
NoelStephensUnity added a commit that referenced this pull request Apr 10, 2025
…ort) (#3388)

This is the back port of #3387 that resolves some issues with in-scene
placed NetworkObjects in parent-child hierarchy and the synchronization
of late joining clients when the hierarchy has changed from that of its
default hierarchy defined within the scene.


[MTT-11883](https://jira.unity3d.com/browse/MTT-11883)

## Changelog

- Fixed: Issue where in-scene placed `NetworkObjects` could fail to
synchronize its transform properly (especially without a
`NetworkTransform`) if their parenting changes from the default when the
scene is loaded and if the same scene remains loaded between network
sessions while the parenting is completely different from the original
hierarchy.
- Changed: The scene loading event serialization order for in-scene
placed `NetworkObject`s to be based on their parent-child hierarchy.



## Testing and Documentation

- Includes no additional tests (_requires manual testing due to scene
loading constraints_).
- No documentation changes or additions were necessary.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
port:1.x-completed This issue was ported to 1.X branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant