Search Unity

Editor Pause Button Problem

Discussion in 'Editor & General Support' started by MajorParts, May 10, 2021.

  1. MajorParts

    MajorParts

    Joined:
    Sep 27, 2014
    Posts:
    88
    I have noticed that pausing the editor doesn't stop time accumulation.
    When gameobjects positions are determined with time involved in the calculation, pausing the editor, waiting a while, unpausing, will cause the objects to suddenly be somewhere else and not carry on from where they were when first paused.
    Not a problem in a build but can get annoying when bug testing.

    2020.3.2f
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,674
    It certainly stops Time.time.

    It would also stop your own
    myTime += Time.deltaTime;
    , which should be how you do your own times. Otherwise you game would fail on replays if it counted on Time.time being zero at scene start.

    Bonus: the above construct also stops counting when you set
    Time.timeScale = 0;
    , which I find is the easiest way to pause any game.

    Editor pause and Time.timeScale = 0 does NOT stop Time.realTimeSinceStartup.