Skip to content

NetworkTransform misses sync when GameObject is re-enabled; add option for automatic reassertion #3435

Open
@Wyndar

Description

@Wyndar

Description
When using NetworkTransform in server-authoritative mode, if a NetworkObject is deactivated on clients (e.g. via SetActive(false) or scene streaming), any transform changes (e.g. via Teleport) made while it's inactive are not propagated to the client once it's re-enabled. This results in position mismatches, where the client sees the object at its old position while the server has already moved it.

There is no warning, and the desync is silent unless manually corrected.

Reproduction Steps
Spawn a server-authoritative NetworkObject with a NetworkTransform

Deactivate the object on all clients (via RPC or reparenting in a disabled object)

On the server, call Teleport(...) to move the object

Reactivate the object after a short delay

Observe: the client does not reflect the new position

Expected Behavior
Clients should receive the latest authoritative position of the object when it becomes active again.

Workarounds
Currently, we must:

Reapply Teleport() after reactivating the object, or

Use a coroutine to delay the teleport until the object is re-enabled, or

Use custom NetworkVariable logic or whatever boiler plate works instead of NetworkTransform

Suggested Fixes
Add a forceResyncOnEnable bool on NetworkTransform

Internally store the last known transform state, and resend it on reactivation

Or provide an OnNetworkObjectReenabled callback for developers to manually reassert state

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority:lowThis issue has low priority and will take some time to be resolvedstat:awaiting-responseAwaiting response from author. This label should be added manually.stat:importedStatus - Issue is tracked internally at Unitytype:featureNew feature, request or improvementtype:feature-2.xNew NGO 2.0.0 feature, request or improvementtype:supportQuestions or other support

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions