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
- Animator Controller Layer name stays unchanged in Layers tab when renamed from Inspector
- [RenderingDebugger]Motion vectors are displayed when Phong Tessellation is used on the material and Skinned Motion Vectors are enabled on the GameObject's Skinned Mesh Renderer component
- Shader Graph Enum Keywords always select last element in Entries when Stages is set to Fragment and Recursive Rendering is enabled in the Scene
- [Mac] Glitchy visual artifacts appear when moving around a scene with Sphere Handles
- Crash on memcpy_repmovs when selecting NavMesh Agent objects while in Play Mode in a specific scene
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.