Search Issue Tracker
Won't Fix
Votes
0
Found in
2018.4.0f1
2019.2.0a1
2019.3.0a1
2020.1.0a1
Issue ID
1195439
Regression
No
Argument exception is thrown on drawing the next button after coming back from a task when using async/await
Steps to reproduce:
1. Create a new project
2. Attach the provided script ("Foo.cs") to any GameObject in the Scene
3. Press on the GameObject which has the script attached
4. In GameObjects Inspector press "Do time consuming stuff" Button
Expected result: No errors or exceptions are thrown
Actual result: "ArgumentException: You can only call GUI functions from inside OnGUI." exception is thrown
Reproducible with: 2018.4.13f1, 2019.2.13f1, 2019.3.0b11, 2020.1.0a13
Couldn't test with: 2017.4 due to "Feature `asynchronous functions' cannot be used because it is not part of the C# 4.0 language specification"
Notes:
- In 2019.2.0a1 the exception is thrown constantly without end
- Buttons that are drawn before the button that runs a task don't throw any exceptions when the button that runs the task is pressed
- The bug reproduces the same both in Play Mode and Edit Mode
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 Toolkit throws warning and fails to clear references when fields are not typed as UnityEngine.Object
- "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
Resolution Note (2020.1.X):
Low priority defect and unlikely to be fixed for the near future.