Search Unity

how restore default parameters of the components ?

Discussion in 'Editor & General Support' started by sir-Gio, Jan 21, 2021.

  1. sir-Gio

    sir-Gio

    Joined:
    Jan 20, 2020
    Posts:
    14
    Hi
    I have made numerous parameter changes in StandardAsset/Environment/Water/Water4Simple. I was working on the scene instance of the frefab.
    It appeared that the changes were saved in the original prefab and work throughout the project in all scenes.
    I would like to go back to the factory settings. Reset (gear/reset) does not change anything. Reloading prefab also does not change anything. What should I do?
     
  2. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    In versions of Unity prior to 2018.3, when you make a change to a prefab in a scene, there was an Apply button at the top of the Inspector. If you hit Apply, it would take the changes to this scene instance of the prefab and apply them to the original prefab in the Assets folder, for use everywhere else you use the prefab. In later versions, this was moved under an Overrides drop down, but essentially does the same thing. You hit Apply, and the original prefab is changed to how this instance is configured. You don't hit apply, and you're just making changes to this instance, which shouldn't affect the original prefab or any other instances.

    So if after you apply changes to the original prefab you then want to revert those changes, the easiest way is using your version control system. You'd just issue a single command to revert it back to whatever previous revision you want. Takes about 10 seconds.

    If you're not using version control (for any serious project you should), then I'd try reimporting just this asset from the Standard Assets pack again. That will probably work.
     
  3. sir-Gio

    sir-Gio

    Joined:
    Jan 20, 2020
    Posts:
    14
    I work on UNITY 2018.4
    I have reimported prefab Water4simple, and even did reimport all. But the parameters still have not been restored to factory settings. :( I have also tried to import directly from Asset Store, but it knows, that I have this package on my computer and imports only missing elements. Then I have deleted Water asset from the project an imported this package manually menue/assets/import package from Standard Asset location on my disc. Succes. I got factory setting.
    On the right part of the component tab in inspector there is the icon when i can save curren setting. But how can I restore this setting from this saved settings ? There is no any botton for it.
     
  4. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    I'm not sure which save current settings option you're talking about, but it sounds like you're a bit confused how prefab overrides work. If you apply the current prefab overrides back on the original, you are overwriting the settings on the original. Once you do that, the original settings are lost in favor of the new settings. If you want to have a unique instance of a prefab in a scene, different from the original prefab without modifying the original, you can change the parameters of that instance and then save the scene not the prefab. But in that case, make sure you don't apply the overrides back to the original prefab, cause you're be changing the original prefab instead of just this instance of it.

    https://docs.unity3d.com/Manual/PrefabInstanceOverrides.html

    I think you're running into a problem somewhere in the above. But if instead you want to be able to save changes back to the original prefab, and then later revert those changes in the future, you need to start using a version control system. That's exactly what those systems are for. If you change the original prefab, Unity itself doesn't have its own version control system to go back to previous revisions of the original prefab.
     
  5. sir-Gio

    sir-Gio

    Joined:
    Jan 20, 2020
    Posts:
    14
    I'm not sure which save current settings option you're talking about
    Clipboard01.jpg

    maybe it's meant for something else.

    "If you apply the current prefab overrides back on the original, you are overwriting the settings on the original"
    .... "you can change the parameters of that instance and then save the scene not the prefab"

    I do nothing more as only save the scene.

    Thank you very much for your explanations. I will try to follow your advices.
    Edit:
    Only some settings are added to the drop down list under button "Overrides". E.g. settings for Normals, Fresnel, Fading, all settings in Gestner Displace component appear in each instance and in root prefab in the whole project. It is not possible to select "apply" or "revert" for them. This is what is causing me difficulties and what I don't understand.
    Clipboard02.jpg
     
    Last edited: Jan 23, 2021
  6. sir-Gio

    sir-Gio

    Joined:
    Jan 20, 2020
    Posts:
    14
    Solved. This parameters belongs to Material. You must copy the material, change the name and new setting will be saved.