Skip to content

Commit

Permalink
fix: NetworkTransform half float synch (#2791)
Browse files Browse the repository at this point in the history
* fix

Fixing the issue with HalfFloat position not keeping the base position synchronized when using unreliable deltas.
  • Loading branch information
NoelStephensUnity authored Dec 13, 2023
1 parent 1cac76a commit 53b735c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion com.unity.netcode.gameobjects/Components/NetworkTransform.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 53b735c

Please sign in to comment.