Skip to content

Commit b14c13b

Browse files
Merge branch 'develop-2.0.0' into experimental/v3-x-x/unified
2 parents ebed5f6 + 7567aca commit b14c13b

29 files changed

Lines changed: 124 additions & 32 deletions

com.unity.netcode.gameobjects/CHANGELOG.md

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,10 @@ Additional documentation and release notes are available at [Multiplayer Documen
1010

1111
### Added
1212

13-
- The `NetworkMetricsPipelineStage` for Unity Transport is now part of the public API. This allows using it in custom implementations of `INetworkStreamDriverConstructor` that want to maintain compatibility with the multiplayer tools package. (#3853)
13+
- `NetworkTransport.EarlyUpdate` and `NetworkTransport.PostLateUpdate` are now public. For the vast majority of users, there's really no point in ever calling those methods directly (the `NetworkManager` handles it). It's only useful if wrapping transports outside of NGO. (#3890)
1414

1515
### Changed
1616

17-
- Updating usage of deprecated `FindObjectsByType(FindObjectsSortMode)` and enum `FindObjectSortMode` in 6000.4 and 6000.5. (#3857)
1817

1918
### Deprecated
2019

@@ -24,16 +23,30 @@ Additional documentation and release notes are available at [Multiplayer Documen
2423

2524
### Fixed
2625

27-
- Fixed issue where `NetworkVariable` was not properly synchronizing to changes made by the spawn and write authority during `OnNetworkSpawn` and `OnNetworkPostSpawn`. (#3878)
28-
- Fixed issue where `NetworkManager` was not cleaning itself up if an exception was thrown while starting. (#3864)
29-
- 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)
3026

3127
### Security
3228

3329

3430
### Obsolete
3531

3632

33+
## [2.10.0] - 2026-03-01
34+
35+
### Added
36+
37+
- The `NetworkMetricsPipelineStage` for Unity Transport is now part of the public API. This allows using it in custom implementations of `INetworkStreamDriverConstructor` that want to maintain compatibility with the multiplayer tools package. (#3853)
38+
39+
### Changed
40+
41+
- Updating usage of deprecated `FindObjectsByType(FindObjectsSortMode)` and enum `FindObjectSortMode` in 6000.4 and 6000.5. (#3857)
42+
43+
### Fixed
44+
45+
- Fixed `NetworkTransform` issue where a user could enable UseUnreliableDeltas while SwitchTransformSpaceWhenParented was also enabled (and vice versa). (#3875)
46+
- Fixed issue where `NetworkVariable` was not properly synchronizing to changes made by the spawn and write authority during `OnNetworkSpawn` and `OnNetworkPostSpawn`. (#3878)
47+
- Fixed issue where `NetworkManager` was not cleaning itself up if an exception was thrown while starting. (#3864)
48+
- 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)
49+
3750
## [2.9.0] - 2026-02-01
3851

3952
### Added

com.unity.netcode.gameobjects/Documentation~/components/helper/networktransform.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ The following NetworkTransform properties can cause a full state update when cha
7575
- __Use Quaternion Compression__
7676
- __Use Half Float Precision__
7777

78+
> [!NOTE]
79+
> **UseUnreliableDeltas** cannot be enabled if **SwitchTransformSpaceWhenParented** is enabled since **SwitchTransformSpaceWhenParented** requires deltas to be sent reliably.
80+
7881
### Axis to Synchronize
7982

8083
![image](../../images/networktransform/AxisToSynchronize.png)
@@ -180,6 +183,7 @@ To resolve this issue, you can enable the __Switch Transform Space When Parented
180183
Things to consider when using __Switch Transform Space When Parented__:
181184

182185
- 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.
186+
- This property cannot be enabled when **UseUnreliableDeltas** is enabled as it requires deltas to be sent reliably.
183187
- 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.
184188
- 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.
185189

com.unity.netcode.gameobjects/Editor/NetworkTransformEditor.cs

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,13 +185,45 @@ private void DisplayNetworkTransformProperties()
185185
EditorGUILayout.Space();
186186
EditorGUILayout.LabelField("Delivery", EditorStyles.boldLabel);
187187
EditorGUILayout.PropertyField(m_TickSyncChildren);
188-
EditorGUILayout.PropertyField(m_UseUnreliableDeltas);
188+
// If both are set from a previous configuration, then SwitchTransformSpaceWhenParented takes
189+
// precedence.
190+
if (networkTransform.UseUnreliableDeltas && networkTransform.SwitchTransformSpaceWhenParented)
191+
{
192+
networkTransform.UseUnreliableDeltas = false;
193+
}
194+
GUI.enabled = !networkTransform.SwitchTransformSpaceWhenParented;
195+
if (networkTransform.SwitchTransformSpaceWhenParented)
196+
{
197+
EditorGUILayout.BeginHorizontal();
198+
EditorGUILayout.PropertyField(m_UseUnreliableDeltas);
199+
EditorGUILayout.LabelField($"Cannot use with {nameof(NetworkTransform.SwitchTransformSpaceWhenParented)}.");
200+
EditorGUILayout.EndHorizontal();
201+
}
202+
else
203+
{
204+
EditorGUILayout.PropertyField(m_UseUnreliableDeltas);
205+
}
206+
GUI.enabled = true;
207+
189208
EditorGUILayout.Space();
190209
EditorGUILayout.LabelField("Configurations", EditorStyles.boldLabel);
191-
EditorGUILayout.PropertyField(m_SwitchTransformSpaceWhenParented);
210+
GUI.enabled = !networkTransform.UseUnreliableDeltas;
211+
if (networkTransform.UseUnreliableDeltas)
212+
{
213+
EditorGUILayout.BeginHorizontal();
214+
EditorGUILayout.PropertyField(m_SwitchTransformSpaceWhenParented);
215+
EditorGUILayout.LabelField($"Cannot use with {nameof(NetworkTransform.UseUnreliableDeltas)}.");
216+
EditorGUILayout.EndHorizontal();
217+
}
218+
else
219+
{
220+
EditorGUILayout.PropertyField(m_SwitchTransformSpaceWhenParented);
221+
}
222+
GUI.enabled = true;
192223
if (m_SwitchTransformSpaceWhenParented.boolValue)
193224
{
194225
m_TickSyncChildren.boolValue = true;
226+
networkTransform.UseUnreliableDeltas = false;
195227
}
196228
else
197229
{

com.unity.netcode.gameobjects/Runtime/Components/HalfVector3.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using System;
12
using System.Runtime.CompilerServices;
23
using Unity.Mathematics;
34
using UnityEngine;
@@ -12,6 +13,7 @@ namespace Unity.Netcode.Components
1213
/// individual axis and the 16 bits of the half float are stored as <see cref="ushort"/> values since C# does not have
1314
/// a half float type.
1415
/// </remarks>
16+
[Serializable]
1517
public struct HalfVector3 : INetworkSerializable
1618
{
1719
internal const int Length = 3;

com.unity.netcode.gameobjects/Runtime/Components/HalfVector4.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using System;
12
using System.Runtime.CompilerServices;
23
using Unity.Mathematics;
34
using UnityEngine;
@@ -12,6 +13,7 @@ namespace Unity.Netcode.Components
1213
/// individual axis and the 16 bits of the half float are stored as <see cref="ushort"/> values since C# does not have
1314
/// a half float type.
1415
/// </remarks>
16+
[Serializable]
1517
public struct HalfVector4 : INetworkSerializable
1618
{
1719
internal const int Length = 4;

com.unity.netcode.gameobjects/Runtime/Components/Interpolator/BufferedLinearInterpolator.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ namespace Unity.Netcode
1010
/// Partially solves for message loss. Unclamped lerping helps hide this, but not completely
1111
/// </summary>
1212
/// <typeparam name="T">The type of interpolated value</typeparam>
13+
14+
[Serializable]
1315
public abstract class BufferedLinearInterpolator<T> where T : struct
1416
{
1517
// Constant absolute value for max buffer count instead of dynamic time based value. This is in case we have very low tick rates, so

com.unity.netcode.gameobjects/Runtime/Components/NetworkDeltaPosition.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using System;
12
using System.Runtime.CompilerServices;
23
using Unity.Mathematics;
34
using UnityEngine;
@@ -7,6 +8,7 @@ namespace Unity.Netcode.Components
78
/// <summary>
89
/// Used to synchromnize delta position when half float precision is enabled
910
/// </summary>
11+
[Serializable]
1012
public struct NetworkDeltaPosition : INetworkSerializable
1113
{
1214
internal const float MaxDeltaBeforeAdjustment = 64f;

com.unity.netcode.gameobjects/Runtime/Components/NetworkTransform.cs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1370,6 +1370,7 @@ public enum AuthorityModes
13701370
/// are sent using a reliable fragmented sequenced network delivery.
13711371
/// </summary>
13721372
/// <remarks>
1373+
/// Cannot be used when <see cref="SwitchTransformSpaceWhenParented"/> is enabled. <br />
13731374
/// The following more critical state updates are still sent as reliable fragmented sequenced:<br />
13741375
/// <list type="bullet">
13751376
/// <item><description>The initial synchronization state update.</description></item>
@@ -1570,6 +1571,7 @@ internal bool SynchronizeScale
15701571
/// When de-parented: Automatically transitions into world space and coverts any pending interpolation states to the relative local space on non-authority instances.<br />
15711572
/// </summary>
15721573
/// <remarks>
1574+
/// Cannot be used if <see cref="UseUnreliableDeltas"/> is enabled. <br />
15731575
/// Only works with <see cref="NetworkTransform"/> components that are not paired with a <see cref="NetworkRigidbody"/> or <see cref="NetworkRigidbody2D"/> component that is configured to use the rigid body for motion.<br />
15741576
/// <see cref="TickSyncChildren"/> will automatically be set when this is enabled.
15751577
/// This field is auto-synchronized with non-authority clients when changed by the authority instance.
@@ -1969,6 +1971,28 @@ private void TryCommitTransform(bool synchronize = false, bool settingState = fa
19691971
m_UseRigidbodyForMotion = m_NetworkRigidbodyInternal.UseRigidBodyForMotion;
19701972
}
19711973
#endif
1974+
// Authority check to assure that UseUnreliableDeltas is not set during runtime while using SwitchTransformSpaceWhenParented.
1975+
if (SwitchTransformSpaceWhenParented && UseUnreliableDeltas)
1976+
{
1977+
// If we didn't have UseUnreliableDeltas previously set...
1978+
if (!m_LocalAuthoritativeNetworkState.FlagStates.UnreliableFrameSync)
1979+
{
1980+
if (m_CachedNetworkManager.LogLevel <= LogLevel.Normal)
1981+
{
1982+
NetworkLog.LogWarning($"[{nameof(NetworkTransform)}][{name}] Reverting {nameof(UseUnreliableDeltas)} back to false as it cannot be enabled while {nameof(SwitchTransformSpaceWhenParented)} is enabled!");
1983+
}
1984+
UseUnreliableDeltas = false;
1985+
}
1986+
else // Otherwise SwitchTransformSpaceWhenParented has changed while UseUnreliableDeltas was already set.
1987+
{
1988+
if (m_CachedNetworkManager.LogLevel <= LogLevel.Normal)
1989+
{
1990+
NetworkLog.LogWarning($"[{nameof(NetworkTransform)}][{name}] Reverting {nameof(SwitchTransformSpaceWhenParented)} back to false as it cannot be enabled while {nameof(UseUnreliableDeltas)} is enabled!");
1991+
}
1992+
SwitchTransformSpaceWhenParented = false;
1993+
}
1994+
}
1995+
19721996
// If the transform has deltas (returns dirty) or if an explicitly set state is pending
19731997
if (m_LocalAuthoritativeNetworkState.ExplicitSet || CheckForStateChange(ref m_LocalAuthoritativeNetworkState, synchronize, forceState: settingState))
19741998
{

com.unity.netcode.gameobjects/Runtime/Core/NetworkManager.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -960,6 +960,7 @@ public NetworkPrefabHandler PrefabHandler
960960
/// <see cref="Unity.Netcode.RpcTarget.Not{T}(T)"/>
961961
/// </summary>
962962
#pragma warning restore IDE0001
963+
[NonSerialized]
963964
public RpcTarget RpcTarget;
964965

965966
/// <summary>

com.unity.netcode.gameobjects/Runtime/NetworkVariable/Collections/NetworkList.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ namespace Unity.Netcode
1010
/// </summary>
1111
/// <typeparam name="T">The type for the list</typeparam>
1212
[GenerateSerializationForGenericParameter(0)]
13+
[Serializable]
1314
public class NetworkList<T> : NetworkVariableBase where T : unmanaged, IEquatable<T>
1415
{
1516
private NativeList<T> m_List = new NativeList<T>(64, Allocator.Persistent);

0 commit comments

Comments
 (0)