Search Issue Tracker
By Design
Votes
0
Found in
2017.4.12f1
Issue ID
1084597
Regression
No
Time.captureFramerate is broken for values less than 90
Time.captureFramerate is returning incorrect values. The attached project contains the following test:
[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));
}
And it is returning the following results;
For a value of 60
CaptureFramerate_WhenSet_MakesDeltaTimeConstant(60) (0.017s)
---
Expected: 0.0166666675f +/- 0.00999999978f
But was: 0.0333333351f
For a value of 30:
CaptureFramerate_WhenSet_MakesDeltaTimeConstant(30) (0.017s)
---
Expected: 0.0333333351f +/- 0.00999999978f
But was: 0.100000001f
10:
CaptureFramerate_WhenSet_MakesDeltaTimeConstant(10) (0.020s)
---
Expected: 0.100000001f +/- 0.00999999978f
But was: 1.0f
1:
CaptureFramerate_WhenSet_MakesDeltaTimeConstant(1) (0.035s)
---
Expected: 1.0f +/- 0.00999999978f
But was: 0.0166480541f
This case is similar to https://fogbugz.unity3d.com/f/cases/1084575/ but it appears to be broken in a different way (this was found when trying to find where care 1084575 broke)
Comments (1)
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Mouse input is registered incorrectly in Custom RP when downscaling Render Target and rendering Overlay UI before final upscale
- Time.deltaTime is locked to the display's refresh rate when the built Player is moved to a Secondary Display and Windowed Mode is used
- Crash on RaiseException when importing a specific asset
- Crash on RaiseException when opening a specific project
- DownloadHandlerScript.CompleteContent is called twice when building for WebGL
hueda
Oct 19, 2018 06:26
ME TO!