File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
com.unity.netcode.gameobjects/Runtime/Components Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -3929,7 +3929,11 @@ private void UpdateInterpolation()
39293929#else
39303930 var cachedDeltaTime = Time . deltaTime ;
39313931#endif
3932- var tickLatency = m_CachedNetworkManager . NetworkTimeSystem . TickLatency + InterpolationBufferTickOffset ;
3932+
3933+ // Optional user defined tick offset to be used to push the "render time" (the time that will be used to determine if a state update is available)
3934+ // back in order to provide more room for the interpolator to interpolate towards when latency conditions are impacting the frequency that state
3935+ // updates are received.
3936+ var tickLatency = Mathf . Max ( 1 , m_CachedNetworkManager . NetworkTimeSystem . TickLatency + InterpolationBufferTickOffset ) ;
39333937
39343938 // If using an owner authoritative motion model
39353939 if ( ! IsServerAuthoritative ( ) )
@@ -3946,13 +3950,8 @@ private void UpdateInterpolation()
39463950 }
39473951 }
39483952 }
3949- // Optional user defined tick offset to be used to push the "render time" (the time that will be used to determine if a state update is available)
3950- // back in order to provide more room for the interpolator to interpolate towards when latency conditions are impacting the frequency that state
3951- // updates are received.
3952- tickLatency += InterpolationBufferTickOffset ;
39533953
39543954 var tickLatencyAsTime = m_CachedNetworkManager . LocalTime . TimeTicksAgo ( tickLatency ) . Time ;
3955-
39563955 // Smooth dampening and extrapolation specific:
39573956 // We clamp between the tick rate frequency and the tick latency x tick rate frequency
39583957 var minDeltaTime = m_CachedNetworkManager . LocalTime . FixedDeltaTime ;
You can’t perform that action at this time.
0 commit comments