- Home /
Combining two meshes
I'm working on making some of my own meshes in runtime. Just simple things like boxes and cylinders, but I'm having a little trouble. I want to simply combine a cylinder and cone to make an arrow, but when I try I get an empty game object. Here's what I'm trying to do.
public static Mesh CombineTwoMesh(Mesh mesh1, Mesh mesh2)
{
CombineInstance[] combine = new CombineInstance[2];
combine[0].mesh = mesh1;
combine[1].mesh = mesh2;
Mesh newMesh = new Mesh();
newMesh.CombineMeshes(combine);
return newMesh;
}
Where I call this basically with my arrowMesh and coneMesh. I hope to expand upon it with the transforms in CombineInstance, but I can't seem to get it to work this way. Any help or tips would be appreciated.
BTW, I know I could do this with stacked gameObjects, but I'm trying to avoid as much hiearchy as I can for the intended simple uses I'm perceiving here.
Your answer
Follow this Question
Related Questions
Distribute terrain in zones 3 Answers
How to Move Vertices from a Mesh to a Specific Location 2 Answers
How can i get the center of intersection of two capsules 2 Answers
Multiple Cars not working 1 Answer