Search Issue Tracker
Third Party Issue
Votes
0
Found in
2022.3.58f1
6000.0.38f1
6000.1.0b6
6000.2.0a3
Issue ID
UUM-97497
Regression
No
[sw-unity-6-1] Code is executed twice in a Coroutine when "WaitUntil(() => Input.GetKeyDown())" is used with "while(true)"
How to reproduce:
1. Open the "ReportingBugs.zip" project
2. Open the "WaitUntilScene" Scene
3. Enter Play Mode
4. Press the "F" key on your keyboard
5. Observe the Hierarchy
Expected result: One "Cube (Clone)" GameObject is instantiated
Actual result: Two "Cube (Clone)" GameObjects are instantiated
Reproducible in: 2022.3.58f1, 6000.0.38f1, 6000.1.0b6, 6000.2.0a3
Reproduced on: Windows 11 Pro (23H2)
Not reproduced on: No other environment tested
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
- var VisionOSEDRHeadromm has a comma instead of a dot when building with Metal Rendering App Mode and local OS localization is set to German
- IAP Catalog remove product “x” and add product “+” buttons are not consistent with other remove and add buttons in the Editor
- Performance issues in Play Mode when quickly hovering the mouse cursor over Hierarchy GameObjects
- Frame Debugger displays incorrect output when FidelityFX Super Resolution or Spatial-Temporal Upscaler is used with Temporal Anti-aliasing or Subpixel Morphological Anti-aliasing
- The layout system is failing to correctly calculate or apply the height of the Japanese fallback font when the primary English font's metrics are used
Resolution Note:
The user code is actually to blame here as the second WaitUntil call happens within the same frame as the one that got unblocked by the key press. Luckilly it seems WaitUntil today always wait for at least one frame so it does not end up with an infinite loop, but that is what I expected by looking at the code: within the same frame, Input.GetKeyDown(KeyCode.F) will always return true.