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
- "Customize handled extensions" part in the External Tools settings tab is not aligned with other properties
- Editor Diagnostics foldouts do not open when clicked on the foldout title
- [UI Builder] Visual Elements are not placed at the mouse cursor position when Absolute Position Placement is enabled
- "Width" and "Height" text is misaligned with slider ends in Screen Match Mode Parameters section of Panel Settings Asset
- Editor does not quit when Editor is not in focus and any floating window is opened
hueda
Oct 19, 2018 06:26
ME TO!