Search Unity

Prefab changes aren't saved

Discussion in 'Assets and Asset Store' started by kudim, Aug 22, 2018.

  1. kudim

    kudim

    Joined:
    Aug 29, 2017
    Posts:
    4
    Hi guys. Here's my issue:
    I'm trying to change the color of prefab item, but i can't do it. I really do not understand why my changes are not saved.
    The first screenshot:
    i moved my prefab to hierarchy
    the second screenshot:
    1) i changed the color of prefab item
    2) and moved the prefab back
    the third screenshot
    the color was not changed

    Why??why my changes weren't saved??

    thank you in advance!
     

    Attached Files:

  2. Neviah

    Neviah

    Joined:
    Dec 1, 2016
    Posts:
    235
    In the inspector, hit the "Apply" button near the top to save the changes to your prefab.
     
  3. kudim

    kudim

    Joined:
    Aug 29, 2017
    Posts:
    4
    It didn't help me
     
  4. Neviah

    Neviah

    Joined:
    Dec 1, 2016
    Posts:
    235
    In screenshot 2, you do not need to drag the prefab from the hierarchy back to the project location. Just hit the "apply", delete the prefab in the hierarchy, and drag it from bottom to the scene again and see if it saved. Let me know.
     
  5. kudim

    kudim

    Joined:
    Aug 29, 2017
    Posts:
    4
    I tried to do as you had said, but it didn't still work.
    I'm sorry i didn't tell you at once, but the problem is that, if i change another item for example outline's color, this change will be saved.
    Once for a long time ago I faced the same problem, and then i somehow resolved it, but i don't remember how.
     

    Attached Files:

  6. YakDevChris

    YakDevChris

    Joined:
    Sep 21, 2017
    Posts:
    1
    Did you solve this? Because I'm seeing the same behaviour but on an OnClick destination
     
  7. kudim

    kudim

    Joined:
    Aug 29, 2017
    Posts:
    4
    Unfortungly, did not. It is very strange problem.
     
  8. madskillzHD

    madskillzHD

    Joined:
    Jul 18, 2014
    Posts:
    4
    Late reply, but for anyone looking for a solution, after doing your changes in inspector, hit "ctrl + shift + n" which will create an empty gameobject in the prefab hierarchy, then delete the empty object and it will save changes. Don't ask me why it works, I have no clue.
     
  9. Dzianis

    Dzianis

    Joined:
    Dec 28, 2012
    Posts:
    4
    Faced the same issue with changing object coordinates. Trick with create-delete empty object didn't help. Very strange issue...
     
  10. ifonlyme1000

    ifonlyme1000

    Joined:
    Jan 24, 2019
    Posts:
    8
    Hi, please help. For some reasons all UI objects preffabs are not working properly. Changes I made in the preffab mode are not saved. Autosave is enabled. No problem with non-UIobjects. I have even deactivated antivirus. I have reinstalled unity many times. Nothing helps. What should I d0?
     
  11. DEM12334

    DEM12334

    Joined:
    Apr 8, 2022
    Posts:
    1
    Hey, please help. For some reason when I add a UI element to my player object and try to save the changes the changes are not getting saved can anyone help please.
     
  12. HairDreyer

    HairDreyer

    Joined:
    Aug 28, 2021
    Posts:
    3
    This issue is also happening for me. Whenever a prefab is opened and a property changed (for example: material, color, serialized variable etc.) nothing is written to disk. Literally not a single thing is being changed on the prefab (i can verify this, since git diff is the exact same).

    Solution:
    Following @madskillzHD instructions on creating a new child object works! It for some reason actually writes the changes to disk including the other changes made.

    One shouldn't need to add an empty each time they should save a value
    Info:
    The prefab is a completely unpacked prefab variant.
    Have encountered issue on Unity version 2022.2.1f1, 2022.2.15f1
     
  13. isabelleus95

    isabelleus95

    Joined:
    Apr 5, 2023
    Posts:
    7
  14. jack111one1

    jack111one1

    Joined:
    May 1, 2018
    Posts:
    3
    Note that values not saving in prefab can also be caused by the visibility of the property. If the property is private and not serialized, unity will not consider it when saving changes. The value either needs to be public or serialized. Some custom editor solutions may involve hiding and showing properties in inspector (Odin), so worth mentioning.