Skip to content

NetworkTransform.useHalfFloatPercision causes initial sync to not work properly #2549

Closed
@AlexEnnerfelt

Description

@AlexEnnerfelt

Description

I just updated to 1.4.0
Using NetworkTransform.useHalfFloatPercision seems to cause an issue on initial value sync where it doesn't sync the position of an object before starting to write the deltas. This results in objects being offset by arbitrary distances.

I am using the ClientNetworkTransform as it is implemented in the example.

Reproduce Steps

  1. Create an object with a ClientNetworkTransform with useHalfFloatPercision = true
  2. Spawn it with ownership
  3. Connect with another client and spawn the same object with ownership

Actual Outcome

Sometimes, (unclear what the pattern is) one or both of the objects are offset from their actual position on the owner client, and only updating the delta.
Turning off useHalfFloatPercision (even at runtime) resolves this.

Expected Outcome

For the position on the owner client to be synced properly on the other clients

Environment

  • OS: Windows 11
  • Unity Version: 2022.2.17
  • Netcode Version: 1.4.0
  • Netcode Commit: [e.g. https://github.com/Unity-Technologies/com.unity.netcode.gameobjects/commit/ba418fa5b600ad9eb61fab0575f12fbecc2c6520]

Additional Context

Add any other context about the problem here. Logs, code snippets would be useful here but please also consider attaching a minimal Unity project that reproduces the 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