Skip to content

Commit fc9ee50

Browse files
test and update
Clearing out the 2nd rate of change. Adding delay for the end of the last test in NetworkTransformGeneral.
1 parent 7d02134 commit fc9ee50

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ public void Clear()
192192
m_LastMeasurementAddedTime = 0.0;
193193
InterpolateState.Reset(default);
194194
m_RateOfChange = default;
195+
m_PredictedRateOfChange = default;
195196
}
196197

197198
/// <summary>
@@ -211,6 +212,7 @@ public void ResetTo(T targetValue, double serverTime, bool isAngularValue = fals
211212
private void InternalReset(T targetValue, double serverTime, bool isAngularValue = false, bool addMeasurement = true)
212213
{
213214
m_RateOfChange = default;
215+
m_PredictedRateOfChange = default;
214216
// Set our initial value
215217
InterpolateState.Reset(targetValue);
216218
m_IsAngularValue = isAngularValue;

com.unity.netcode.gameobjects/Tests/Runtime/NetworkTransform/NetworkTransformGeneral.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ public void NonAuthorityOwnerSettingStateTest([Values] Interpolation interpolati
302302
var newRotation = Quaternion.Euler(1, 2, 3);
303303
var newScale = new Vector3(2.0f, 2.0f, 2.0f);
304304
m_NonAuthoritativeTransform.SetState(newPosition, null, null, interpolate);
305-
var success = WaitForConditionOrTimeOutWithTimeTravel(() => PositionsMatchesValue(newPosition), 800);
305+
var success = WaitForConditionOrTimeOutWithTimeTravel(() => PositionsMatchesValue(newPosition), 120);
306306
Assert.True(success, $"Timed out waiting for non-authoritative position state request to be applied!");
307307
Assert.True(Approximately(newPosition, m_AuthoritativeTransform.transform.position), "Authoritative position does not match!");
308308
Assert.True(Approximately(newPosition, m_NonAuthoritativeTransform.transform.position), "Non-Authoritative position does not match!");
@@ -324,7 +324,7 @@ public void NonAuthorityOwnerSettingStateTest([Values] Interpolation interpolati
324324
newScale = new Vector3(0.5f, 0.5f, 0.5f);
325325

326326
m_NonAuthoritativeTransform.SetState(newPosition, newRotation, newScale, interpolate);
327-
success = WaitForConditionOrTimeOutWithTimeTravel(() => PositionRotationScaleMatches(newPosition, newRotation.eulerAngles, newScale));
327+
success = WaitForConditionOrTimeOutWithTimeTravel(() => PositionRotationScaleMatches(newPosition, newRotation.eulerAngles, newScale), 120);
328328
Assert.True(success, $"Timed out waiting for non-authoritative position, rotation, and scale state request to be applied!");
329329
Assert.True(Approximately(newPosition, m_AuthoritativeTransform.transform.position), "Authoritative position does not match!");
330330
Assert.True(Approximately(newPosition, m_NonAuthoritativeTransform.transform.position), "Non-Authoritative position does not match!");

0 commit comments

Comments
 (0)