fix: Parenting does not preserve WorldPositionStays option and other parenting related issues
When parenting and setting the WorldPositionStays to false on the server, clients would not apply the same WorldPositionStays setting because it was not being synchronized. This PR also provides parent child serialization ordering during the initial client synchronization that happens when the connection is approved. MTT-4616
For Visual Validation via Manual Testing:
Use the companion test project PR #2207
Changelog
-
Added: Position, rotation, and scale to the
ParentSyncMessagewhich provides users the ability to specify the final values on the server-side whenOnNetworkObjectParentChangedis invoked just before the message is created (when theTransformvalues are applied to the message). -
Fixed: Issue where the
WorldPositionStaysparenting parameter was not being synchronized with clients. -
Fixed: Issue where parented in-scene placed
NetworkObjects would fail for late joining clients. -
Fixed: Issue where scale was not being synchronized which caused issues with nested parenting and scale when
WorldPositionStayswas true. -
Fixed: Issue with
NetworkTransform.ApplyTransformToNetworkStateWithInfowhere it was not honoring axis sync settings whenNetworkTransformState.IsTeleportingNextFramewas true. -
Fixed: issue with
NetworkTransform.TryCommitTransformToServerwhere it was not honoring theInLocalSpacesetting.
Testing and Documentation
- Includes integration test that validates with and without
WorldPositionStays. - Includes additional parenting tests (WIP)
- Documentation updates are necessary. (PR-778)
Code looks good... will approve once tests are committed.