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
- "Shader warning in 'Hidden/Light2D': implicit truncation of vector type" is thrown when building Universal 2D template
- AI Assistant breaks compilation of packages using System.Runtime.CompilerServices.Unsafe via auto-referencing
- Unity Hub checks the "Documentation" module by default on the 6.4 and 6.5 streams despite that it was unchecked with the previous installs
- Shortcut that toggles between Dopesheet and Curves Views in the Animation Window's Timeline is mislabed
- Property List Items Overlap onto the Property List's top edge when scrolling through a long Property List
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.