Netcode for GameObjects is a high-level netcode SDK that provides networking capabilities to GameObject/MonoBehaviour workflows within Unity and sits on top of underlying transport layer.
This is a special case for client-server where a server is spawning an owner authoritative NetworkObject but has yet to serialize anything. When the server detects that:
We are not in a distributed authority session (DAHost check).
This is the first/root NetworkTransform.
The root NetworkTransform is owner authoritative.
The NetworkObject is not owned by the server.
The SynchronizeState.IsSynchronizing is set to false.
Then the server would skip the final initialization step which resulted in the loss of the initial SynchronizeState settings.
This PR checks for the above conditions during the initial spawning of a NetworkObject and then:
Makes sure the SynchronizingState is updated to the instantiated prefab's default flags/settings.
Forces the SynchronizingState.IsSynchronizing flag so the NetworkTransform runs through the final initialization steps.
Fixed: Issue with nested NetworkTransform components clearing their initial prefab settings when in owner authoritative mode on the server side while using a client-server network topology which resulted in improper synchronization of the nested NetworkTransform components.
Testing and Documentation
Includes integration test updates.
No documentation changes or additions were necessary.
This is a special case for client-server where a server is spawning an owner authoritative
NetworkObject
but has yet to serialize anything. When the server detects that:NetworkTransform
.NetworkTransform
is owner authoritative.NetworkObject
is not owned by the server.SynchronizeState.IsSynchronizing
is set to false. Then the server would skip the final initialization step which resulted in the loss of the initialSynchronizeState
settings.This PR checks for the above conditions during the initial spawning of a
NetworkObject
and then:SynchronizingState
is updated to the instantiated prefab's default flags/settings.SynchronizingState.IsSynchronizing
flag so theNetworkTransform
runs through the final initialization steps.MTTB-483
fix: #3082
Changelog
NetworkTransform
components clearing their initial prefab settings when in owner authoritative mode on the server side while using a client-server network topology which resulted in improper synchronization of the nestedNetworkTransform
components.Testing and Documentation