- Home /
why does the error "Deleting persistent object without writing it first" occurs ?
Loading a Prefab from a AssetBundle I get this error "Deleting persistent object without writing it first" and nand I dont know why does it happens. Any ideas?
Answer by Gunder · Mar 02, 2010 at 04:20 PM
The problem is try to modify a load resource (not a instantiated one). Thanks for all.
This doesn't work for me:( I am creating an editor script in which I get this message when I unload bundles. When loading a bundle initially I put them into an array (for later unloading)- I instantiate and make modifications ONLY on to those instantiated objects. When the time comes to unload the asset bundles, I loop through the asset bundle array and unload- but this is when I get the error. So ,the only modification to the actual asset I am doing is unloading. Should I get this error when unloading?
Answer by Lucas Meijer 1 · Feb 17, 2010 at 09:23 PM
Can you get this to happen reliably? If so, could you be so kind to send a (smaller=better) sample of when this happens? (UnityMenu->Help->Report a problem).
... And don't forget to link to this question ;-)
I can reproduce it by loading a prefab from assetbundle (*.unity3d file), then removing a component from it (audio for instance). After I stop the application, the console contains such message.
Answer by yuriythebest · Apr 04, 2012 at 06:43 PM
you probably changed the name of the assetbundle
even if you modify the .name of a loaded AssetBundle you'll get this error. happened to me in my loader script
Answer by quicktom · Feb 01, 2013 at 01:22 PM
if you serialize a variable which a material, and you assign a texture to MainTexture of that material, then the error will occur. You can new a material with same shader, then assign texture to it, then you can safely use the material variable.