From 6efc639432ca12529624ed9656353af565201660 Mon Sep 17 00:00:00 2001 From: Noel Stephens Date: Mon, 9 Feb 2026 12:23:14 -0600 Subject: [PATCH 1/7] fix Prevent user from selecting use unreliable deltas when SwitchTransformSpaceWhenParented is enabled (and vice versa). Adding check during runtime to also notify the user that this combination does not work (i.e. missed updates can result in a missed transform update when parenting changes). --- .../Editor/NetworkTransformEditor.cs | 36 +++++++++++++++++-- .../Runtime/Components/NetworkTransform.cs | 10 ++++++ 2 files changed, 44 insertions(+), 2 deletions(-) diff --git a/com.unity.netcode.gameobjects/Editor/NetworkTransformEditor.cs b/com.unity.netcode.gameobjects/Editor/NetworkTransformEditor.cs index 62d565e753..b52620b6f7 100644 --- a/com.unity.netcode.gameobjects/Editor/NetworkTransformEditor.cs +++ b/com.unity.netcode.gameobjects/Editor/NetworkTransformEditor.cs @@ -184,13 +184,45 @@ private void DisplayNetworkTransformProperties() EditorGUILayout.Space(); EditorGUILayout.LabelField("Delivery", EditorStyles.boldLabel); EditorGUILayout.PropertyField(m_TickSyncChildren); - EditorGUILayout.PropertyField(m_UseUnreliableDeltas); + // If both are set from a previous configuration, then SwitchTransformSpaceWhenParented takes + // precedence. + if (networkTransform.UseUnreliableDeltas && networkTransform.SwitchTransformSpaceWhenParented) + { + networkTransform.UseUnreliableDeltas = false; + } + GUI.enabled = !networkTransform.SwitchTransformSpaceWhenParented; + if (networkTransform.SwitchTransformSpaceWhenParented) + { + EditorGUILayout.BeginHorizontal(); + EditorGUILayout.PropertyField(m_UseUnreliableDeltas); + EditorGUILayout.LabelField($"Cannot use with {nameof(NetworkTransform.SwitchTransformSpaceWhenParented)}."); + EditorGUILayout.EndHorizontal(); + } + else + { + EditorGUILayout.PropertyField(m_UseUnreliableDeltas); + } + GUI.enabled = true; + EditorGUILayout.Space(); EditorGUILayout.LabelField("Configurations", EditorStyles.boldLabel); - EditorGUILayout.PropertyField(m_SwitchTransformSpaceWhenParented); + GUI.enabled = !networkTransform.UseUnreliableDeltas; + if (networkTransform.UseUnreliableDeltas) + { + EditorGUILayout.BeginHorizontal(); + EditorGUILayout.PropertyField(m_SwitchTransformSpaceWhenParented); + EditorGUILayout.LabelField($"Cannot use with {nameof(NetworkTransform.UseUnreliableDeltas)}."); + EditorGUILayout.EndHorizontal(); + } + else + { + EditorGUILayout.PropertyField(m_SwitchTransformSpaceWhenParented); + } + GUI.enabled = true; if (m_SwitchTransformSpaceWhenParented.boolValue) { m_TickSyncChildren.boolValue = true; + networkTransform.UseUnreliableDeltas = false; } else { diff --git a/com.unity.netcode.gameobjects/Runtime/Components/NetworkTransform.cs b/com.unity.netcode.gameobjects/Runtime/Components/NetworkTransform.cs index 15109c93db..2518c2c6ab 100644 --- a/com.unity.netcode.gameobjects/Runtime/Components/NetworkTransform.cs +++ b/com.unity.netcode.gameobjects/Runtime/Components/NetworkTransform.cs @@ -1958,6 +1958,16 @@ private void TryCommitTransform(bool synchronize = false, bool settingState = fa m_UseRigidbodyForMotion = m_NetworkRigidbodyInternal.UseRigidBodyForMotion; } #endif + // Authority check to assure that UseUnreliableDeltas is not set during runtime while using SwitchTransformSpaceWhenParented. + if (SwitchTransformSpaceWhenParented && UseUnreliableDeltas && !m_LocalAuthoritativeNetworkState.FlagStates.UnreliableFrameSync) + { + if (m_CachedNetworkManager.LogLevel <= LogLevel.Normal) + { + Debug.LogWarning($"Reverting {nameof(UseUnreliableDeltas)} back to fals as it cannot be enable while {nameof(SwitchTransformSpaceWhenParented)} is enabled!"); + } + UseUnreliableDeltas = false; + } + // If the transform has deltas (returns dirty) or if an explicitly set state is pending if (m_LocalAuthoritativeNetworkState.ExplicitSet || CheckForStateChange(ref m_LocalAuthoritativeNetworkState, synchronize, forceState: settingState)) { From 5406e2eaa61165c92f88a489358e68e4ce51181f Mon Sep 17 00:00:00 2001 From: Noel Stephens Date: Mon, 9 Feb 2026 12:32:53 -0600 Subject: [PATCH 2/7] update Updating XML API to reflect the changes. --- .../Runtime/Components/NetworkTransform.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/com.unity.netcode.gameobjects/Runtime/Components/NetworkTransform.cs b/com.unity.netcode.gameobjects/Runtime/Components/NetworkTransform.cs index 2518c2c6ab..322756ceae 100644 --- a/com.unity.netcode.gameobjects/Runtime/Components/NetworkTransform.cs +++ b/com.unity.netcode.gameobjects/Runtime/Components/NetworkTransform.cs @@ -1370,6 +1370,7 @@ public enum AuthorityModes /// are sent using a reliable fragmented sequenced network delivery. /// /// + /// Cannot be used when is enabled.
/// The following more critical state updates are still sent as reliable fragmented sequenced:
/// /// The initial synchronization state update. @@ -1570,6 +1571,7 @@ internal bool SynchronizeScale /// When de-parented: Automatically transitions into world space and coverts any pending interpolation states to the relative local space on non-authority instances.
/// /// + /// Cannot be used if is enabled.
/// Only works with components that are not paired with a or component that is configured to use the rigid body for motion.
/// will automatically be set when this is enabled. /// This field is auto-synchronized with non-authority clients when changed by the authority instance. From 80a2f210ef402182c54cdc2bb8745c7756c0b8f9 Mon Sep 17 00:00:00 2001 From: Noel Stephens Date: Mon, 9 Feb 2026 12:37:59 -0600 Subject: [PATCH 3/7] update Updating documentation. --- .../Documentation~/components/helper/networktransform.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/com.unity.netcode.gameobjects/Documentation~/components/helper/networktransform.md b/com.unity.netcode.gameobjects/Documentation~/components/helper/networktransform.md index b0bca748fe..aeccc960a7 100644 --- a/com.unity.netcode.gameobjects/Documentation~/components/helper/networktransform.md +++ b/com.unity.netcode.gameobjects/Documentation~/components/helper/networktransform.md @@ -75,6 +75,9 @@ The following NetworkTransform properties can cause a full state update when cha - __Use Quaternion Compression__ - __Use Half Float Precision__ +> [!NOTE] +> **UseUnreliableDeltas** cannot be enabled if **SwitchTransformSpaceWhenParented** is enabled since **SwitchTransformSpaceWhenParented** requires deltas to be sent reliably. + ### Axis to Synchronize ![image](../../images/networktransform/AxisToSynchronize.png) @@ -180,6 +183,7 @@ To resolve this issue, you can enable the __Switch Transform Space When Parented Things to consider when using __Switch Transform Space When Parented__: - This property is synchronized by the authority instance. If you disable it on the authority instance then it will synchronize this adjustment on all non-authority instances. +- This property cannot be enabled when **UseUnreliableDeltas** is enabled as it requires deltas to be sent reliably. - When using __Switch Transform Space When Parented__, it's best to not make adjustments to the __NetworkTransform.InLocalSpace__ field and let the NetworkTransform handle this for you. - While you can still change __In Local Space__ directly via script while __Switch Transform Space When Parented__ is enabled, this could impact the end results. It is recommended to not adjust __In Local Space__ when __Switch Transform Space When Parented__ is enabled. From 54e4087c4ca3528b0f0a25c373d52dc4481f6fe9 Mon Sep 17 00:00:00 2001 From: Noel Stephens Date: Mon, 9 Feb 2026 12:41:36 -0600 Subject: [PATCH 4/7] update Adding changelog entry. Removing white space. --- com.unity.netcode.gameobjects/CHANGELOG.md | 1 + com.unity.netcode.gameobjects/Editor/NetworkTransformEditor.cs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/com.unity.netcode.gameobjects/CHANGELOG.md b/com.unity.netcode.gameobjects/CHANGELOG.md index 127203e7d3..5c66fc5668 100644 --- a/com.unity.netcode.gameobjects/CHANGELOG.md +++ b/com.unity.netcode.gameobjects/CHANGELOG.md @@ -24,6 +24,7 @@ Additional documentation and release notes are available at [Multiplayer Documen ### Fixed +- Fixed `NetworkTransform` issue where a user could enable UseUnreliableDeltas while SwitchTransformSpaceWhenParented was also enabled (and vice versa). (#3875) - Fixed issue where `NetworkManager` was not cleaning itself up if an exception was thrown while starting. (#3864) - Prevented a `NullReferenceException` in `UnityTransport` when using a custom `INetworkStreamDriverConstructor` that doesn't use all the default pipelines and the multiplayer tools package is installed. (#3853) diff --git a/com.unity.netcode.gameobjects/Editor/NetworkTransformEditor.cs b/com.unity.netcode.gameobjects/Editor/NetworkTransformEditor.cs index b52620b6f7..31f3314bea 100644 --- a/com.unity.netcode.gameobjects/Editor/NetworkTransformEditor.cs +++ b/com.unity.netcode.gameobjects/Editor/NetworkTransformEditor.cs @@ -185,7 +185,7 @@ private void DisplayNetworkTransformProperties() EditorGUILayout.LabelField("Delivery", EditorStyles.boldLabel); EditorGUILayout.PropertyField(m_TickSyncChildren); // If both are set from a previous configuration, then SwitchTransformSpaceWhenParented takes - // precedence. + // precedence. if (networkTransform.UseUnreliableDeltas && networkTransform.SwitchTransformSpaceWhenParented) { networkTransform.UseUnreliableDeltas = false; From 5446a6ef054e05bcdab394ee8c94ad0b89235b6d Mon Sep 17 00:00:00 2001 From: Noel Stephens Date: Mon, 9 Feb 2026 12:49:36 -0600 Subject: [PATCH 5/7] update Including the scenario where SwitchTransformSpaceWhenParented was set while UseUnreliableDeltas had already been set. --- .../Runtime/Components/NetworkTransform.cs | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/com.unity.netcode.gameobjects/Runtime/Components/NetworkTransform.cs b/com.unity.netcode.gameobjects/Runtime/Components/NetworkTransform.cs index 322756ceae..1c95ee2eb2 100644 --- a/com.unity.netcode.gameobjects/Runtime/Components/NetworkTransform.cs +++ b/com.unity.netcode.gameobjects/Runtime/Components/NetworkTransform.cs @@ -1961,13 +1961,25 @@ private void TryCommitTransform(bool synchronize = false, bool settingState = fa } #endif // Authority check to assure that UseUnreliableDeltas is not set during runtime while using SwitchTransformSpaceWhenParented. - if (SwitchTransformSpaceWhenParented && UseUnreliableDeltas && !m_LocalAuthoritativeNetworkState.FlagStates.UnreliableFrameSync) + if (SwitchTransformSpaceWhenParented && UseUnreliableDeltas) { - if (m_CachedNetworkManager.LogLevel <= LogLevel.Normal) + // If we didn't have UseUnreliableDeltas previously set... + if (!m_LocalAuthoritativeNetworkState.FlagStates.UnreliableFrameSync) { - Debug.LogWarning($"Reverting {nameof(UseUnreliableDeltas)} back to fals as it cannot be enable while {nameof(SwitchTransformSpaceWhenParented)} is enabled!"); + if (m_CachedNetworkManager.LogLevel <= LogLevel.Normal) + { + Debug.LogWarning($"Reverting {nameof(UseUnreliableDeltas)} back to false as it cannot be enable while {nameof(SwitchTransformSpaceWhenParented)} is enabled!"); + } + UseUnreliableDeltas = false; + } + else // Otherwise SwitchTransformSpaceWhenParented has changed while UseUnreliableDeltas was already set. + { + if (m_CachedNetworkManager.LogLevel <= LogLevel.Normal) + { + Debug.LogWarning($"Reverting {nameof(SwitchTransformSpaceWhenParented)} back to false as it cannot be enable while {nameof(UseUnreliableDeltas)} is enabled!"); + } + SwitchTransformSpaceWhenParented = false; } - UseUnreliableDeltas = false; } // If the transform has deltas (returns dirty) or if an explicitly set state is pending From a35d97742fdd39e2ee7d022c93ddbb502d9abbde Mon Sep 17 00:00:00 2001 From: Noel Stephens Date: Mon, 9 Feb 2026 12:56:30 -0600 Subject: [PATCH 6/7] style Fixing warning message grammar. --- .../Runtime/Components/NetworkTransform.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/com.unity.netcode.gameobjects/Runtime/Components/NetworkTransform.cs b/com.unity.netcode.gameobjects/Runtime/Components/NetworkTransform.cs index 1c95ee2eb2..2fcc9320df 100644 --- a/com.unity.netcode.gameobjects/Runtime/Components/NetworkTransform.cs +++ b/com.unity.netcode.gameobjects/Runtime/Components/NetworkTransform.cs @@ -1968,7 +1968,7 @@ private void TryCommitTransform(bool synchronize = false, bool settingState = fa { if (m_CachedNetworkManager.LogLevel <= LogLevel.Normal) { - Debug.LogWarning($"Reverting {nameof(UseUnreliableDeltas)} back to false as it cannot be enable while {nameof(SwitchTransformSpaceWhenParented)} is enabled!"); + Debug.LogWarning($"Reverting {nameof(UseUnreliableDeltas)} back to false as it cannot be enabled while {nameof(SwitchTransformSpaceWhenParented)} is enabled!"); } UseUnreliableDeltas = false; } @@ -1976,7 +1976,7 @@ private void TryCommitTransform(bool synchronize = false, bool settingState = fa { if (m_CachedNetworkManager.LogLevel <= LogLevel.Normal) { - Debug.LogWarning($"Reverting {nameof(SwitchTransformSpaceWhenParented)} back to false as it cannot be enable while {nameof(UseUnreliableDeltas)} is enabled!"); + Debug.LogWarning($"Reverting {nameof(SwitchTransformSpaceWhenParented)} back to false as it cannot be enabled while {nameof(UseUnreliableDeltas)} is enabled!"); } SwitchTransformSpaceWhenParented = false; } From 778fdfd8c5d758c51122d84b744bb1dad12a7970 Mon Sep 17 00:00:00 2001 From: Noel Stephens Date: Mon, 9 Feb 2026 13:37:51 -0600 Subject: [PATCH 7/7] update Including NetworkTransform and the name in the warning logged when trying to set one or the other while either one is set. --- .../Runtime/Components/NetworkTransform.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/com.unity.netcode.gameobjects/Runtime/Components/NetworkTransform.cs b/com.unity.netcode.gameobjects/Runtime/Components/NetworkTransform.cs index 2fcc9320df..64e9bc0b95 100644 --- a/com.unity.netcode.gameobjects/Runtime/Components/NetworkTransform.cs +++ b/com.unity.netcode.gameobjects/Runtime/Components/NetworkTransform.cs @@ -1968,7 +1968,7 @@ private void TryCommitTransform(bool synchronize = false, bool settingState = fa { if (m_CachedNetworkManager.LogLevel <= LogLevel.Normal) { - Debug.LogWarning($"Reverting {nameof(UseUnreliableDeltas)} back to false as it cannot be enabled while {nameof(SwitchTransformSpaceWhenParented)} is enabled!"); + NetworkLog.LogWarning($"[{nameof(NetworkTransform)}][{name}] Reverting {nameof(UseUnreliableDeltas)} back to false as it cannot be enabled while {nameof(SwitchTransformSpaceWhenParented)} is enabled!"); } UseUnreliableDeltas = false; } @@ -1976,7 +1976,7 @@ private void TryCommitTransform(bool synchronize = false, bool settingState = fa { if (m_CachedNetworkManager.LogLevel <= LogLevel.Normal) { - Debug.LogWarning($"Reverting {nameof(SwitchTransformSpaceWhenParented)} back to false as it cannot be enabled while {nameof(UseUnreliableDeltas)} is enabled!"); + NetworkLog.LogWarning($"[{nameof(NetworkTransform)}][{name}] Reverting {nameof(SwitchTransformSpaceWhenParented)} back to false as it cannot be enabled while {nameof(UseUnreliableDeltas)} is enabled!"); } SwitchTransformSpaceWhenParented = false; }