Skip to content

Commit d2b552e

Browse files
update
Sigh...
1 parent 4170dfe commit d2b552e

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

com.unity.netcode.gameobjects/Runtime/Components/Interpolator/BufferedLinearInterpolator.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ public void AddDeltaTime(float deltaTime)
166166

167167
public void SetTimeToTarget(double timeToTarget)
168168
{
169+
m_AverageDeltaTime = 0.0f;
169170
DeltaTimePredict = 0.0f;
170171
LerpTPredict = 0.0f;
171172
LerpT = 0.0f;
@@ -350,20 +351,16 @@ private void TryConsumeFromBuffer(double renderTime, double minDeltaTime, double
350351
if (!InterpolateState.Target.HasValue)
351352
{
352353
InterpolateState.Target = target;
353-
354354
alreadyHasBufferItem = true;
355-
InterpolateState.CurrentValue = target.Item;
356355
InterpolateState.PredictValue = InterpolateState.CurrentValue;
357356
InterpolateState.PreviousValue = InterpolateState.CurrentValue;
358357
InterpolateState.Phase1Value = InterpolateState.CurrentValue;
359358
InterpolateState.Phase2Value = InterpolateState.CurrentValue;
360359
InterpolateState.SetTimeToTarget(minDeltaTime);
361360
InterpolateState.TimeToTargetValue = minDeltaTime;
362361
startTime = InterpolateState.Target.Value.TimeSent;
363-
InterpolateState.TargetReached = true;
362+
InterpolateState.TargetReached = false;
364363
InterpolateState.PredictingNext = false;
365-
InterpolateState.LerpT = 1.0f;
366-
InterpolateState.LerpTPredict = 1.0f;
367364
InterpolateState.MaxDeltaTime = maxDeltaTime;
368365
}
369366
else

0 commit comments

Comments
 (0)