Search Issue Tracker
Won't Fix
Votes
2
Found in
2020.1.0a4
2020.3
2020.3.31f1
Issue ID
1411917
Regression
Yes
[M1] Incorrect calculation of values using multiplication with Mathf.Sqrt() when an unused variable is declared
How to reproduce:
1. Open the user attached "M1 Issue Repo Package.zip" project
2. Open the "SampleScene" Scene
3. Enter Play Mode
Expected result: "nonZeroValue = 8.660254" is logged
Actual result: "nonZeroValue = 0" is logged
Reproducible with: 2020.1.0a4, 2020.3.33f1
Not Reproducible with: 2019.4.38f1, 2020.1.0a3, 2021.3.1f1, 2022.1.0f1, 2022.2.0a11
Note:
- Reproducible on a new project
- Not reproducible on non-Silicon macOS and Windows
- Switching to Debug Mode and entering Play Mode shows the correct values
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
- Articulation Body with 'Revolute' Joint Type has erratic behavior when Upper Limit is set to above 360
- WebGL Player fails to render Scene when Terrain with Detail Mesh is added and WebGPU Graphics API is used
- Inconsistent errors are logged when different types are passed into the Query "Q<>" method in UIToolkit and the ancestor VisualElement is null
- Crash on GetMaterialPropertyByIndex when opening a specific Scene
- Discrepancies in the styling are present when using a TSS file instead of a USS file in custom EditorWindow
Resolution Note (2020.3.X):
After investigation it was determined that this issue was fixed by the mono upgrade starting in version 2021.2 and backporting the required changes to 2020.3 would be non-trivial. The issue only reproduces in the editor and not during a mac standalone player runtime. It is also easy to work-around by performing the Sqrt function on a separate line than the multiplication. While this isn't ideal it will have to suffice to bridge the gap to where this issue is fixed in later versions. Additionally the defining of an unused variable appears to not be required to reproduce the bug.