Skip to content

Commit bed3a33

Browse files
style
Adding additional comment on the max delta time calculation.
1 parent e453cdf commit bed3a33

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3862,6 +3862,10 @@ private void UpdateInterpolation()
38623862
// Smooth dampening specific:
38633863
// We clamp between tick rate and bit beyond the tick rate but not 2x tick rate (we predict 2x out)
38643864
var minDeltaTime = m_CachedNetworkManager.LocalTime.FixedDeltaTime;
3865+
// The 1.666667f value is a "magic" number tht lies between the FixedDeltaTime and 2 * the averaged
3866+
// frame update. Since smooth dampening is most useful for Rigidbody motion, the physics update
3867+
// frequency is roughly 60hz (59.x?) which 2x that value as frequency is typically close to 32-33ms.
3868+
// Look within the Interpolator.Update for smooth dampening to better understand the above.
38653869
var maxDeltaTime = (1.666667f * m_CachedNetworkManager.ServerTime.FixedDeltaTime);
38663870

38673871
// Now only update the interpolators for the portions of the transform being synchronized

0 commit comments

Comments
 (0)