Search Issue Tracker

By Design

Votes

0

Found in

2019.1.0a2

Issue ID

1084575

Regression

No

Time.captureFrame is broken for values less than 60

Input

-

Time.captureFrame is broken for values less than 60. The attached project contains an automated test that confirms this. The test is:

[Test]
public void CaptureFramerate_WhenSet_MakesDeltaTimeConstant([Values(1, 10, 30, 60, 90, 72)] int rate)
{
Time.captureFramerate = rate;
Assert.That(Time.deltaTime, Is.EqualTo(1f / rate).Within(0.01f));
}

Running the test returns:

CaptureFramerate_WhenSet_MakesDeltaTimeConstant(30) (0.001s)
---
Expected: 0.0333333351f +/- 0.00999999978f
But was: 0.0163280964f

CaptureFramerate_WhenSet_MakesDeltaTimeConstant(10) (0.001s)
---
Expected: 0.100000001f +/- 0.00999999978f
But was: 0.0163280964f

CaptureFramerate_WhenSet_MakesDeltaTimeConstant(1) (0.033s)
---
Expected: 1.0f +/- 0.00999999978f
But was: 0.0163280964f

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.