Skip to content

Updating from 1.0.2 to 1.1.0 leads to different behaviour for in-scene placed NetworkObjects regarding initial scale and position. #2278

Closed
@davidyrgilbert

Description

@davidyrgilbert

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.

  1. 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.

  1. 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)

This leads to a wrongly scaled Child Cube on the Client in 1.1.0.

Reproduce Steps

  1. Checkout the sample at https://github.com/VRGroupRWTH/netcode_issue
  2. Start a second unity instance (ParrelSync is included)
  3. Load Bootstrap scene on both
  4. Start Server on one
  5. Start Client on the other
  6. Switch Netcode version
  7. Restart Unity and repeat

Actual Outcome

  1. Only the Parent Cube is being moved on the client.
  2. The Childcube has the wrong scale applied on the client.
  3. 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

Metadata

Metadata

Labels

priority:highThis issue has high priority and we are focusing to resolve itstat:importedStatus - Issue is tracked internally at Unitytype:bugBug Report

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions