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
- Crash on GfxDeviceD3D12::AllocBottomLevelAccelerationStructure when using Raytracing
- The search icon in the "Searches" sections is blurry and inconsistent
- "RenderingCommandBuffer" error is thrown when switching to the tvOS platform
- Left side cog menu button is obstructed by the maximum Y value of the graph when editing a curve in the Particle System Curves
- "Property exceeds previous array size (64 vs 32)." warnings are thrown when switching from tvOS platform to a Standalone platform after restarting the Editor
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.