Search Unity

How to Properly Use PrefabUtility.RecordPrefabInstancePropertyModifications ?

Discussion in 'Editor & General Support' started by AhSai, Jun 28, 2019.

  1. AhSai

    AhSai

    Joined:
    Jun 25, 2017
    Posts:
    129
    I have a button in my custom inspector gui that will change the position of a child of my Prefab. In the script, I use PrefabUtility.RecordPrefabInstancePropertyModifications(target); after the position has changed, but when I exit and re-enter prefab mode, the position didn't get saved. How do I save the changes automatically?
     
    leni8ec likes this.