I’m making a procedural mesh, and I currently don’t know how to apply multiple materials to that mesh.
I looked online, a few very brief forum posts mentioned using mesh.SetTriangles().
I haven’t seen an implementation of this yet, so I’m a little confused as to how to actually use this method.
So far I’m getting bad results!
In the attached image, I broke up my triangles array which was an array of ints. I then set triangles for each part of the mesh I wanted governed by a different material.
thank you for this Mexicano!
after creating a new Mesh, do Mesh.Clear() before setting any vertices, normals, UVs or triangles.
for some reason this works…
Mesh mesh = new Mesh();
mesh.Clear();
mesh.SetVertices(vertices);
etc…