Combine meshes with different materials

Hi all,

I have two meshes that I want to merge with combine meshes but when I use the combineMeshes function, the resulting mesh uses only one material, even though the two meshes were of different materials. How do I fix this?

Use sub-meshes. http://unity3d.com/support/documentation/ScriptReference/Mesh.CombineMeshes.html : " If mergeSubMeshes is true, all the meshes will be combined to a single submesh. Otherwise each mesh will go into a different submesh. If all meshes share the same material, set this to true. "

You can check out my tool on the unity asset store “Poly Few” which is a complete optimization solution for Unity aimed at making high quality complex 3d scenes render efficiently. With integrated features like mesh simplification, automatic LOD generation, mesh combining and material combining, you can greatly improve the performance of your game by lowering the Polygon Count, DrawCalls and SetPass calls with a few clicks and, without the need of writing even a single line of code.