- Home /
Prefab not saving changes bug
I have some prefabs that have the same script attached to them. I change properties of these prefabs through an Editor script. After reopening unity or building the properties of some of these prefabs are getting reseted to what ever they were before I used my Editor script.
Tryed to use AssetDatabase.SaveAssets(); but didnt help.
Is it a bug? or am I doing something wrong.
Fixed the problem by dublicating the problematic prefabs.
Hello, how did you solve this problem? I didn't understand what you meant by 'dublicating the problematic prefabs'.
Never$$anonymous$$d, fixed the problem by using EditorUtility.SetDirty(myPrefab)
Answer by haim96 · Nov 24, 2013 at 12:37 PM
when you make changes to prefab copy in the editor (prefab in the scene) you need to press "apply" to apply the changes to the master prefab (the one in the asset list)
I'm sorry but this isn't the problem, what we're dealing with here is a problem concerning changing prefabs directly (not the instance) using an editor script.
In my case the change is made successfully but when I close Unity and reopen it any change made with the editor script is gone
$$anonymous$$y prefab file is "empty/default" until I save the project (File/Save Project).
Your answer
Follow this Question
Related Questions
Distance betwen two objects.Error,bug,etc. 2 Answers
How to refference a Prefab in a saving/loading system? 0 Answers
Int adding twice instead of once? 1 Answer
Unity Crashes On Startup 1 Answer