Is there a realtime delay for async await?

Is there a way to use async await in a real-time?

Task. delay’s time is keep on passing when I pause the game unlike WaitForSecondsrealtime

Any help would be appreciated! :slight_smile:

async await can be used in the context of Unity, yes. And given that Unity is for making realtime apps (such as video games) that should answer your question. If not, please provide more context. :wink:

async await works independently from Unity’s other systems, such as the Time class and coroutines and “yield new WaitForWhoKnowsWhat()”. The former is true background processing, coroutines are simply methods that are called at certain points during each update cycle, with yield statements allowing you to postpone resuming the execution of the coroutine method at the point where it yielded, by providing a condition such as “wait for end of frame” or “wait for 2 seconds in real time”. Here, “real time” means the time that passes regardless of whatever time step is currently set in Unity that affects processing speed (including pausing the game if time step is 0). Async await completely ignores all of this timing done by Unity because it is a general C# background processing concept.

Thank you for the replay! I guess I said it in reverse. I need to make await async to not move the time while the game is paused. :slight_smile: