Description
Description
I've noticed a breaking change or bug regarding the initial syncing of in-scene places NetworkObjects that had either their position changed before a client connects, or which are in a hierarchy that contains scaled GameObjects.
Below is a link to a sample project which demonstrates this better than I can explain.
For both issues, the server starts on a bootstrap scene and then loads a SampleScene via the (Network)SceneManager.
The described setups are in the SampleScene.
- Initial position sync for in-scene placed network objects:
Given the following scene setup:
- Parent Cube (No NetworkObject)
- Child Cube (NetworkObject)
They are stacked on each other somewhere in the scene. On Start(), the Parent Cube is moved from its original position to the desired one (0, 0.5, 0), such that the stack appears right in front of the respective players - Start() is executed on both client and server. This works fine on the connecting client in 1.0.2, but in 1.1.0 only the parent cube is being moved.
- Initial scale sync for in-scene places network objects:
Given the following scene setup:
- Parent Cube (No NetworkObject)
- Scale Gameobject (No NetworkObject)
- Scaled Child Cube (NetworkObject)
- Scale Gameobject (No NetworkObject)
This leads to a wrongly scaled Child Cube on the Client in 1.1.0.
Reproduce Steps
- Checkout the sample at https://github.com/VRGroupRWTH/netcode_issue
- Start a second unity instance (ParrelSync is included)
- Load Bootstrap scene on both
- Start Server on one
- Start Client on the other
- Switch Netcode version
- Restart Unity and repeat
Actual Outcome
- Only the Parent Cube is being moved on the client.
- The Childcube has the wrong scale applied on the client.
- Both are correct on the Host, and on 1.0.2 on the client as well.
Expected Outcome
1.0.2 and 1.1.0 lead to the same result.
Environment
- OS: Windows and Linux (Host, Server, Dedicated Server Build, all lead to the same)
- Unity Version: 2020.3
- Netcode Version: 1.1.0
Additional Context
Minimal sample project is here: https://github.com/VRGroupRWTH/netcode_issue