logoalt Hacker News

edflsafoiewqyesterday at 8:39 PM1 replyview on HN

I understand why coroutines are an issue for saving, but why are they an issue for pausing? Don't you just not resume the coroutines while paused?


Replies

glennerooyesterday at 9:36 PM

It depends. If you are using `yield return new WaitForSecondsRealtime(x)` then the coroutine keeps running when you set TimeScale to 0, but that's usually a feature and not a bug, since it lets you potentially use them when paused (since async/task C# stuff was usually been a bit sketchy, though it's definitely better now).

Some more info here (and in general about pausing in Unity): https://gamedevbeginner.com/the-right-way-to-pause-the-game-...