Search Unity

  1. Unity 2020.2 has been released.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Prefabs saving over and over ?

Discussion in 'Prefabs' started by zh4r0naX, Mar 17, 2019.

  1. zh4r0naX

    zh4r0naX

    Joined:
    Oct 30, 2016
    Posts:
    68
    Hello, ive got a question. Ive got some Problems with my Prefabs, those Prefabs arent big but they keep saving over and over again.

    upload_2019-3-17_23-19-18.png

    This loading bar comes up after saving the project for like 6 times. Same happens when clicking on collab. This is annoying and takes up to a minute, right now ive got just 7 rooms, dont want to imagine how much time i will lose when i got like 100 different rooms.

    Also if i just add a random new script and hit collab it everytime shows that prefabs got changed, while i didnt do.

    how can i find the root of this problem and solve it ?

    When i duplicate a prefab the same message pops up. Its annoying and time consuming. I dont want it to get out of hand when my rooms increase.

    This is what a room is made of

    upload_2019-3-17_23-27-52.png

    Any ideas ?
     
  2. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    5,233
    You can check the root cause through the profiler. Turn on deep profiling and profile editor, and you should get a usable stack trace showing what's causing it.

    Then, send a bug report, because this is obviously not an acceptable performance regression.
     
  3. zh4r0naX

    zh4r0naX

    Joined:
    Oct 30, 2016
    Posts:
    68
    Thank you for your response. Sadly profiler isnt helping me out, could still be everything.

    Ive got one big spike. Prefabs.SavePrefab is using it up. But why are they saved that often ?

    upload_2019-3-18_19-11-55.png
     
  4. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    5,233
    It seems like there's something really bad going on with the new prefab system both getting dirtied way too often, and taking way too long to save.
    Or the system's just exposing some preexisting issues where things gets dirtied when they shouldn't.

    Either way, if you can reproduce this consistently, send a bug report and then @runevision or somebody else working on this can take a look.
     
  5. runevision

    runevision

    Joined:
    Nov 28, 2007
    Posts:
    1,850
    What we've seen in the bug reports we've gotten is:
    • Usage of the SVG package which has an issue that sets Prefab Assets dirty too often. A bug has been assigned to the team maintaining that package.
    • User scripts that mark Prefabs dirty too often.
    As always, if you're seeing issues you think are bugs in Unity, file a bug report. Write the case number here if you want to make sure it ends up on our table.
     
  6. prisonerjohn

    prisonerjohn

    Joined:
    Jul 31, 2013
    Posts:
    23
    I had a similar issue a few weeks ago and realized that there's an Auto-Save toggle in the Prefab editor that is enabled by default. I think what it does is save prefabs every time they change automatically, and that caused my editor to keep checking and updating prefabs non-stop.

    Capture-PrefabSave.PNG

    If that is your issue, also note that this is a per-install setting (not per project), so you'll need to change it on all your machines.
     
    marwan-smg likes this.
  7. zh4r0naX

    zh4r0naX

    Joined:
    Oct 30, 2016
    Posts:
    68
    Thank you for all those answers. Like @runevision mentioned it was a asset which marked prefabs as dirty all the time.. this is now fixed after i contacted the asset developer.

    Thank you all.
     
    runevision likes this.
  8. SteenLund

    SteenLund

    Unity Technologies

    Joined:
    Jan 20, 2011
    Posts:
    588
  9. marwan-smg

    marwan-smg

    Joined:
    Feb 3, 2020
    Posts:
    1
  10. rawboy8128

    rawboy8128

    Joined:
    Jan 27, 2020
    Posts:
    1
    I have the same problem.

    I found that one of my scripts still changes an asset when the unity call OnValidate. So I'll fix it.
     
unityunity