- Home /
Question by
DoctorWhy · Nov 09, 2012 at 10:08 PM ·
prefabunity 4prefabutility
Unity 4 PrefabUtility.InstantiatePrefab problem in OnPostprocessModel
A line of code that worked perfectly in Unity 3.5.6, does not work in 4.
GameObject gObj = PrefabUtility.CreatePrefab(GetPrefabNameForAsset(assetPath), go);
Basically, the prefab is not copying correctly. Anything that relates to the mesh, does not copy over. A reference in the SkinnedMeshRenderer, as well as my own script, become null. On top of that, the animation clips all become null.
This is happening in the OnPostprocessModel
Is this a known issue and is there a work around?
EDIT: After further investigation, this only happens when a prefab is created in OnPostprocessModel. I was able to reproduce it effectively in a clean project and created a bug report https://fogbugz.unity3d.com/default.asp?498132_a8unhv4c81qjeuni
Comment
I'm currently experiencing this. Good job submitting a bug report about it.