Search Issue Tracker
By Design
Votes
1
Found in
2020.1.0a4
2020.1.4f1
2020.2
Issue ID
1278032
Regression
Yes
An error directs to a wrong line in the script when the error is thrown in the Console
How to reproduce:
1. Open user's attached "arrayerror" project
2. Open the "SampleScene" Scene
3. Enter the Play Mode
Expected results: The error in the Console shows that the error is in line 14
Actual results: The error in the Console shows that the error is in line 17
Reproducible with: 2020.1.0a4, 2020.1.6f1, 2020.2.0b3
Not reproducible with: 2018.4.27f1, 2019.4.10f1, 2020.1.0a3
Notes:
- The error will show the closing bracket of the function in which the error has occurred
- The issue seems to appear only on the "Index out of range" error
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
- Rendering into RenderTexture is affected by Camera transforms when using DrawMeshNow
- [MacOS] Switching project functionality when importing a complete project is broken
- UI Toolkit Debugger has no minimum size for its tabs
- Crash on mono_object_get_class when opening the project
- Editing the UnityDOTSInstancing.hlsl file does not cause a Shader recompilation
Resolution Note:
Source code line numbers in managed stack traces might be wrong when the Unity editor is compiling code in release mode (which is the default mode since 2020.1a4).
To get proper source code line numbers, you can change the editor back to debug compilation mode. Check out the little "bug" icon in the lower right of the editor. If to click the down arrow next to it, that will pop up a window which indicates the current mode and allows you to change it. Change to debug mode for correct source code line numbers in stack traces.