Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Question Enter Play Mode time spikes all of a sudden and last until Unity restart

Discussion in 'Editor & General Support' started by Caparrini, Jun 7, 2021.

  1. Caparrini

    Caparrini

    Joined:
    Jun 21, 2017
    Posts:
    51
    When I first open my project I can enter play mode in a couple of seconds, but at some point, that time spikes and it takes longer than before for every time I press Play until I restart Unity. Once starts happening it happens even if I'm just playing a new Empty scene without doing any changes at all. I used the Profiler and I tracked that it seems to get stuck in:
    SpriteAtlasManager.OnEnterPlayModePreAwake > Write asset changes to disk.

    I also noticed that sometimes if in the middle of this I create a new empty scene and I press Play it runs immediately, but if I just stop it and Play it again it does the same thing, taking up to a minute.

    Does anybody know what might be happening and how to solve it?
    Thank you very much

    Here I leave attach a screenshot of the profiler of Entering Play Mode on an empty scene.

    Screenshot 2021-06-07 134510.png
     
    Last edited: Jun 7, 2021
    alesmasiar likes this.
  2. Caparrini

    Caparrini

    Joined:
    Jun 21, 2017
    Posts:
    51
    I found that it does a similar thing just sometimes when I save a scene, no matter how minimal the change in the scene is. Here is a screenshot of that profile

    Profiler_savingScene.png
     
    alesmasiar likes this.
  3. alesmasiar

    alesmasiar

    Joined:
    Apr 10, 2018
    Posts:
    5
    I'm experiencing similar thing in my project.

    upload_2021-6-8_16-9-8.png
     
  4. Unravel1

    Unravel1

    Joined:
    Feb 9, 2019
    Posts:
    2
    Using 2020 LTS over a bunch of minor versions, this issue caused me so much time loss. my project took 4 minutes to save or play or even exit unity. i finally profiled it and came to the same result as this thread. I then disabled the SpritePacker which 'fixed' this issue.

    Edit > Project Settings > Editor > Sprite Packing Mode. either disable this or set it to build only. (not always).

    (this is a hacky work around for something that should be working)
     
  5. Lurking-Ninja

    Lurking-Ninja

    Joined:
    Jan 20, 2015
    Posts:
    9,996
    You left out an important step where you submit the bug report.
     
  6. Unity_Javier

    Unity_Javier

    Unity Technologies

    Joined:
    Mar 7, 2018
    Posts:
    176