Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
Wrong type of adjustment...
  • Loading branch information
NoelStephensUnity committed Aug 25, 2023
1 parent 029434e commit 4a5c14b
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ public void StopMoving()
IsMoving = false;
}

private const int k_MaxThresholdFailures = 4;
private int m_ExceededThresholdCount;

protected override void Update()
Expand All @@ -76,10 +77,10 @@ protected override void Update()
if (transform.position.y < -MinThreshold || transform.position.y > Application.targetFrameRate + MinThreshold)
{
// Temporary work around for this test.
// Really, this test needs to be completely re-written.
// Really, this test needs to be completely re-written.
m_ExceededThresholdCount++;
// If we haven't corrected ourselves in half a network tick, then throw an error
if (m_ExceededThresholdCount > NetworkManager.NetworkConfig.TickRate * 0.5f)
// If we haven't corrected ourselves within the maximum number of updates then throw an error.
if (m_ExceededThresholdCount > k_MaxThresholdFailures)
{
Debug.LogError($"Interpolation failure. transform.position.y is {transform.position.y}. Should be between 0.0 and 100.0. Current threshold is [+/- {MinThreshold}].");
}
Expand Down

0 comments on commit 4a5c14b

Please sign in to comment.