- Home /
How to set custom models from blender to Gameobjects in script.
I am a new unity user and also started to use blender. I've made some simple models, but I have no idea how to set it to Gameobjects I make in my script. I am currently making those objects using the create primitive method, but I can't find out how to set the mesh filter's mesh to my model.
Learn how prefabs work... When your staring out with unity, it's good to fist read through the ENTIRE documentation :)
Answer by Jozxyqk · Jan 01, 2013 at 04:38 AM
Yes, prefabs are probably what you want. You can declare a public Mesh or GameObject ("prefab"/object template) variable in your script. Then drag a mesh or prefab to that variable which unity should expose on the object the script is attached to. You can then use Instantiate() to create an instance of the prefab. If you're intent on using meshes manually, I found this with a quick google:
http://docs.unity3d.com/Documentation/Manual/GeneratingMeshGeometryProcedurally.html
It's more than you need but will give you an idea of how unity handles meshes and materials.
Your answer

Follow this Question
Related Questions
Assign textures to Blender Suicidator city mesh 0 Answers
How to make UV maps offset the same way? 1 Answer
My animation will not play after I apply armature in Blender. 1 Answer
Problems importing plane mesh from blender to unity 1 Answer
Animations work great in Blender, but deform the mesh in unity 1 Answer