- Home /
Separating meshes from imported model
I made an airplane model in Blender and imported it into Unity. Now,here is the problem: I made two sets of wings as I plan player to be able to customize plane in game. As you can see the in screenshot both pairs of wings are visible and are overlaping.
The "dirty" way to achieve this would be to just link wing objects to script and make it deactivate "unneeded" wings.
Is there any more elegant way of doing this? I was thinking something like separating wings from the PlayerAircraft prefab and than making a script that would load just needed pair of wings, but still preserving relative position to the body of airplane.
Actualy, I can't seem to find much info about what happens when I import models into Unity. All I do is drag the model onto the scene and make it a prefab so I can use it in other levels. What are the new untextured meshes that appear under the imported file name?
Answer by crushy · Jul 09, 2012 at 06:21 AM
I think the best way to handle it would be to just have the wings on separate prefabs (and blender files, but that would be up to you). You could use bones on the plane and wings model's to decide where to place the wing meshes in relation to the airplane.
I'm also fairly new to Unity's way of doing things but I would recommend you don't use imported blender files directly as prefabs. Use an empty gameobject, set the blender file as a child and then turn the empty gameobject into a prefab.
As for the meshes I think they're just the individual objects in the blender file, or did I misread your question?
Oh, I see. This approach seems to work a bit better.
If anyone ever gets stuck with the same problem, here is a kind of solution that I use which is parialy based on crushy's answer:
Download "Blender Export Selected" plugin which allows you to export selected objects as new blend file: http://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/Import-Export/Export_Selected
Now, in my example, open Blender and: 1. Save airplane body without wings as first file 2. Save airplane body with 1 set of wings as second file 3. Save airplane body with second set of wings as third file
~~Important: Apply Position, Scale & Rotation for all objects in each file (Ctrl+A) in object mode~~
Now in Unity: 1. $$anonymous$$ake 3 new empty objects, 1 for each .blend file you created 2. Load those files as children of those 3 objects 3. Thats it! Now as you applied position and rotation and scale to those objects, you can select either pair of wings you want and make airplane object it's parent. It will align perfectly without any bones.