- Home /
Combining Meshes, mesh combine a simple working example
Please how do i use combine meshes? etc. EDIT
after much toil, here is a working example, but you would be forgiven for getting errors, because the following example works with 10/100 CUBES but as soon as i change the clones to CYLINDERS, it seems that the combine mesh Magically stops working!!! oooh! fun! another problem to solve, YAY!
anyhow there are modified versions of combine scripts around and threads on their bugs, so time to read them all Again :D
Answer by vestax_ion · Sep 01, 2011 at 03:52 AM
Ok, i spent the weekend doing pretty things in unity, and then i got this first go:
make 2 objects, a spawnpoint (called cube) and a combine object (called combineParent)
Put mesh combine utility onto combine parent using the tabs at the top of unity, select script,
and put this basic instantiate script onto your cube spawnpoint... and drag cube and parent onto the gameobjects in this script in inspector.
press play. in any case this script adn mesch combine utility are all you need, dont need to add extra mesh filters etc.
var cube : GameObject;
var combine1 : GameObject;
//combineObject = GameObject.Find("combineObject");
var qtt = 100;
function Start () {
for (var i : int = 0;i < qtt; i++) {
var copy = Instantiate(cube,Vector3(0,0,i*2), Quaternion.identity);
copy.transform.parent = combine1.transform;
}
}
N.B. make sure your prefabs use default diffuse material to begin with.