Skip to content

Commit b398f93

Browse files
update
Minor adjustment UpdateInterpolation
1 parent bdbb218 commit b398f93

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3922,8 +3922,8 @@ public void Teleport(Vector3 newPosition, Quaternion newRotation, Vector3 newSca
39223922
private void UpdateInterpolation()
39233923
{
39243924
AdjustForChangeInTransformSpace();
3925-
3926-
var currentTime = m_CachedNetworkManager.ServerTime.Time;
3925+
var timeSystem = m_CachedNetworkManager.ServerTime;
3926+
var currentTime = timeSystem.Time;
39273927
#if COM_UNITY_MODULES_PHYSICS || COM_UNITY_MODULES_PHYSICS2D
39283928
var cachedDeltaTime = m_UseRigidbodyForMotion ? Time.fixedDeltaTime : Time.deltaTime;
39293929
#else
@@ -3950,10 +3950,10 @@ private void UpdateInterpolation()
39503950
}
39513951
}
39523952

3953-
var tickLatencyAsTime = m_CachedNetworkManager.ServerTime.TimeTicksAgo(tickLatency).Time;
3953+
var tickLatencyAsTime = timeSystem.TimeTicksAgo(tickLatency).Time;
39543954
// Smooth dampening and extrapolation specific:
39553955
// We clamp between the tick rate frequency and the tick latency x tick rate frequency
3956-
var minDeltaTime = m_CachedNetworkManager.ServerTime.FixedDeltaTimeAsDouble;
3956+
var minDeltaTime = timeSystem.FixedDeltaTimeAsDouble;
39573957

39583958
// Maximum delta time is the maximum time we will lerp between values. If the time exceeds this due to extreme
39593959
// latency then the value's interpolation rate will be accelerated to reach the goal and continue interpolating

0 commit comments

Comments
 (0)