[Solved] Applying multiple materials to a generated mesh object

I am going to be loading a mesh from a file, but I have no idea how to distinguish which triangles should be which material. Once it’s on a GameObject, with a MeshRenderer, I just need to add another material to the materials list, but that’s not my problem

1 Answer

1

I found out how to do this. You must set the subMeshCount in mesh, then use SetTriangles to assign to each submesh, where each submesh is a different material