From 53b735c70fba0c5476fe04b6440320bcd61ed195 Mon Sep 17 00:00:00 2001 From: Noel Stephens Date: Wed, 13 Dec 2023 14:31:27 -0600 Subject: [PATCH] fix: NetworkTransform half float synch (#2791) * fix Fixing the issue with HalfFloat position not keeping the base position synchronized when using unreliable deltas. --- com.unity.netcode.gameobjects/Components/NetworkTransform.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/com.unity.netcode.gameobjects/Components/NetworkTransform.cs b/com.unity.netcode.gameobjects/Components/NetworkTransform.cs index 5b7b2ee415..c463d3955a 100644 --- a/com.unity.netcode.gameobjects/Components/NetworkTransform.cs +++ b/com.unity.netcode.gameobjects/Components/NetworkTransform.cs @@ -1857,7 +1857,8 @@ private bool ApplyTransformToNetworkStateWithInfo(ref NetworkTransformState netw networkState.NetworkDeltaPosition = m_HalfPositionState; - if (m_HalfFloatTargetTickOwnership > m_CachedNetworkManager.ServerTime.Tick && !networkState.IsTeleportingNextFrame) + // If ownership offset is greater or we are doing an axial synchronization then synchronize the base position + if ((m_HalfFloatTargetTickOwnership > m_CachedNetworkManager.ServerTime.Tick || isAxisSync) && !networkState.IsTeleportingNextFrame) { networkState.SynchronizeBaseHalfFloat = true; }