Search Unity

Why can I override a change over and over again, but it never saves?

Discussion in 'Prefabs' started by AcademyOfFetishes, May 28, 2019.

  1. AcademyOfFetishes

    AcademyOfFetishes

    Joined:
    Nov 16, 2018
    Posts:
    219
    Easiest to show this with a gif:

    Can anyone tell me why this never saves? https://imgur.com/PMPlxeL
    Also look at this. No change there that I can see anyway:
     
  2. halley

    halley

    Joined:
    Aug 26, 2013
    Posts:
    2,433
    Were these changes made by a script? If they don't show the blue override bar at the left of the changed property, it won't save.

    Whatever made the changes to a Prefab needs to call various SetDirty methods but also

    UnityEditor.PrefabUtility.RecordPrefabInstancePropertyModifications(eachComponentYouTouch)
     
  3. AcademyOfFetishes

    AcademyOfFetishes

    Joined:
    Nov 16, 2018
    Posts:
    219
    Well, this is a prefab from a library I'm using, and from the 2nd picture, I can't even see any changes, so I'm not sure how to answer your question.
     
  4. halley

    halley

    Joined:
    Aug 26, 2013
    Posts:
    2,433
    The blue line along the left border of the text field which says "Input field" indicates that something set that field to a new value which needs to be saved. The new value may even be identical to the old value, it was just a change recorded as requiring a save.
     
  5. AcademyOfFetishes

    AcademyOfFetishes

    Joined:
    Nov 16, 2018
    Posts:
    219
    Oh wow, that's really subtle and I never noticed it before. Is there anything I can do without a script to say, "Save everything?" My scene is the way I want it so a blanket save would be fine.