Search Issue Tracker

Won't Fix

Votes

0

Found in

2020.3.41f1

2021.3.12f1

2022.1.21f1

2022.2.0b13

2023.1.0a17

Issue ID

UUM-18855

Regression

No

Unity Editor freezes when Task is run faster than every 1000ms

--

-

Reproduction steps:
1. Open the user’s attached project
2. Enter the Play Mode
3. In the Simulator view, click “Start”
4. In the upper-right corner, under “SPAWN TIME”, change 1 to 0.99

Expected result: Cubes are spawned faster
Actual result: Unity Editor freezes

Reproducible with: 2020.3.41f1, 2021.3.12f1, 2022.1.21f1, 2022.2.0b13, 2023.1.0a17

Reproducible on: Windows 11 Pro 21H2

  1. Resolution Note:

    The issues is with the user code (int)_uiSpawnTime * 1000 results in a wait time of 0.

    `await Task.Delay(0)` will be executed synchronously and control of the main thread will never be release. `Math.Max((int) (_uiSpawnTime * 1000), 1)` should solve the issue.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.