Prefab with multiple meshes?
I'm sorry I realize this is a simple question but I'm incredibly new to Unity and the answer is not obvious nor could I find one online. I want to create a prefab with multiple meshes inside. I created the prefab itself and then dragged the first mesh from the hierarchy into the empty prefab. Now if I want to add a second mesh I can't figure out how to do that. If I drag the second mesh into the prefab it replaces the original and doesn't add it. I cannot add a second mesh renderer because there's already one in the prefab and I can't drag the second mesh into the prefab's inspector. How does one go about adding in second (or more) meshes?
Answer by Graphics_Dev · Jan 15, 2016 at 01:46 PM
The way to have multiple meshes in the same prefab is to use parenting. With both of your models in the scene hierarchy, drag one on top of the other. This will create a parent/child relationship between the two objects.
This is an incredibly important concept to learn; check out the parenting section on this page in the Unity docs if you don't already have a firm grasp of this concept http://docs.unity3d.com/Manual/Transforms.html
Finally, drag the parent object to the project window to create a prefab.
Let me know if this helps ;)
Oh yes that's awesome. Didn't know you could parent objects in unity. That is amazingly powerful! Thanks for the answer!
What I did in prefab mode, BUT it doesn't save the materials assigned to the children! This issue is driving me crazy! edit: Figured it out, I had to save the children as prefabs as well! wtf
Your answer
Follow this Question
Related Questions
References in prefabs! 0 Answers
Unity overwrites prefab values in runtime 0 Answers
How to fix "not a prefab scene"? 1 Answer