Search Unity

Question FixedUpdate when Time.timeScale = 0

Discussion in 'Physics' started by Tom163, Jun 8, 2023.

  1. Tom163

    Tom163

    Joined:
    Nov 30, 2007
    Posts:
    1,290
    According to the manual, FixedUpdate should be called independently of the game speed, so even if Time.timeScale = 0, correct?

    Because I don't experience this. When I pause the game by setting Time.timeScale = 0 it seems that FixedUpdate() isn't called anymore. Is that possible?
     
  2. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    2,508
    That may be easily misunderstood. It means that the execution rate of FixedUpdate is fixed and independent of the visual frame rate.

    The game speed is defined by Time.timeScale. For example, 0.5 means half of the real time. To achieve that, FixedUpdate is also called at half of the rate defined by Time.fixedDeltaTime. When timeScale is 0 then FixedUpdate is not called so the gameplay is paused.