Search Issue Tracker

By Design

Votes

0

Found in

2018.3.0a1

2018.3.3f1

Issue ID

1124760

Regression

No

[Support] Altering TimeScale on runtime will make devices unresponsive and application hangs

MacOS

-

How to reproduce:
1. Build and run the project on an iOS device or standalone
--
Notice that the game gets frozen in the splash screen.

Versions:

2018.3.6f1
~Editor: Project launches
~Standalone build: Hangs when launching the app
~iOS build: build successful, hangs when launching the app with Xcode

2019.1.0b4:
~Editor: Couldn't enter play mode due to errors
~Standalone build: Couldn't build due to errors
~iOS: Couldn't build due to errors

2019.2.0a6:
~Editor: Couldn't enter play mode due to errors
~Standalone build: Couldn't build due to errors
~iOS: Couldn't build due to errors

Note: Removing `Time.timeScale = 5; (l21) from the script `FPSCounter.cs' Awake() method, the game runs as expected

  1. Resolution Note (2019.3.X):

    In FPSCounter.CalculateFPS, there is the following code:

    private IEnumerator CalculateFPS()
    {
    WaitForSeconds waitDelay = new WaitForSeconds(FREQUENCY);

    while (true)
    {
    if (Time.timeScale == 1)
    {
    yield return waitDelay;

    /.../
    }
    }
    }

    Now, if Time.timeScale is not 1, this while(true) loop never returns, and you have an endless loop, freezing the game.

    Now, I'ms somewhat surprised that this bug (with a 7GB repro project) went all the way to a Unity developer without anyone apparently trying to attach a debugger to see what is going on before ¯\_(ツ)_/¯

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.