Search Issue Tracker
By Design
Votes
1
Found in
2018.4.0f1
2019.1.0a1
2019.1.2f1
2019.2.0a1
2019.3.0a1
Issue ID
1153873
Regression
No
Mathf.Approximately on similar values do not return true in IL2CPP Standalone
How to reproduce:
1. Open attached project "mathf.approx bug.zip" and scene "Main"
2. Enter Play mode
3. In Game View, press "Begin" button (the "Begin" button changes to "Done", this is expected)
4. Build and Run the standalone with IL2CPP
5. In Standalone, press the "Begin" button
Expected result: the "Begin" button changes to "Done"
Actual result: the "Begin" button is stuck at "Lerping"
Reproducible with: 2018.3.14f1, 2018.4.0f1, 2019.1.3f1, 2019.2.0b2, 2019.3.0a2
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
- UI Builder Scroll button for Code Preview section automatically selects all of the code
- Memory increases indefinitely when playing VLC video stream
- An invisible Element without edges is left over when a Preview is converted to a Floating Window in the Inspector
- All "Multiplayer Center" window becomes blank and "Console" displayes "ArgumentException: Cannot unschedule unknown scheduled function UnityEngine.UIElements.VisualElement+SimpleScheduledItem" when user changes docked "Multiplayer Center" window position
- Closing HDR Color window after selecting a colour with Colour Picker closes HDR Gradient Editor (linear) window as well
Resolution Note:
Floating point behavior is different between Mono and IL2CPP. The problem with the example is this line:
f1 = Mathf.Lerp(startValue, endValue, 21.25f * (Time.time - startTime));
"startValue" should be "f1":
f1 = Mathf.Lerp(f1, endValue, 21.25f * (Time.time - startTime));
Without this change the Mathf.Lerp call is always the same and it results in a value that is not quite the same as the end value, probably due to roundoff errors, so the Approximately call will always return false.