- Home /
can I update prefab Assets with new 3D files without resetting their components?
For example: I have a blend file in my assets folder. I make an empty prefab in the assets folder and put the .blend asset into the prefab. (the prefab isn't part of the scene, it's just in the Asset folder so I can instantiate it into the scene later). After a lot of work, the prefab has a lot of components and settings, but I need to update the original blend. I replace the old .blend asset with an updated .blend, but the prefab is not changed. If I drag the .blend onto the prefab, all of prefab's components and settings are removed.
Answer by pitimoi · Aug 09, 2013 at 04:15 AM
Hi,
With Unity, one of the best practice to keep in mind is to never use your artistic stuff as prefabs. Try to always create an empty prefab that will contains all your logic stuff (scripts, rigibody, colliders...) and add the mesh as a child of this object. Then you just have to change the child in order to set a new mesh or to update it.
I never worked with blend files, but maybe you can just replace each part of the blend file in your prefab (like meshes in renderer component, materials...)
I hope it helps you a bit ;)
Answer by Teh_Bucket · Aug 09, 2013 at 04:31 AM
Thanks, considering these prefabs aren't in the scene itself, can i parent the assets to the prefabs in the Asset folder itself, for instantiation?
Also, components i've just found out are copy and pasteable, which makes this process a lot easier.
the best way to do it is to create an empty gameobject in a new scene, add anything you want to be on your prefab on this gameobject (including meshes as child), then name it as you want and drag it in your project folder. Unity will tranform it into a prefab you can instantiate anywhere ;)
If you want to do further changes to this prefab, just drag it back into a scene, perform any changes you need, then apply your prefab and delete it from the scene !
Thank you very much, I'm using this system now and it works perfectly.
Your answer
Follow this Question
Related Questions
way to get all components of type in all scenes and prefabs 1 Answer
Is this accurate? Scenes are composed of objects are composed of components are composed of assets 1 Answer
Put all Assets in Resources Folder ? 1 Answer
Assagning prefab with component to component 0 Answers
Prefab Sharing Textures 1 Answer