Search Unity

Question Any way to pause Update()

Discussion in 'Windows' started by AliCanKeskin, Sep 20, 2022.

  1. AliCanKeskin

    AliCanKeskin

    Joined:
    Jun 7, 2022
    Posts:
    25
    Hello, I am working on a project with UWP. I was wondering if I can pause the execution of Update for some time (unknown amount of time) and the continue execution from there ?
     
  2. timke

    timke

    Joined:
    Nov 30, 2017
    Posts:
    408
    Generally speaking, you cannot "pause" Update; it's a critical part of the app's run loop (i.e. Game Loop) and pausing it will cause the app to "freeze".

    The only time Update is truly paused is when the app looses focus, in this state Unity will (by default) suspend most I/O and processing functions like reading input, playing audio, as well as suspending calls to Update. Note that you can override this behavior by selecting "Run in Background" option, allowing Unity to continue updating even when the app isn't focused.

    What are you trying to accomplish by pausing Update?
    If you want to "pause the game", see this blog post on how to accomplish this in Unity.