- Home /
CombineInstance[] submesh index
I am constructing a big mesh with small parts as accessories. I want 2 materials, 1 for the accessories, one for the main one. So I thought I'd create a CombineInstance[] with all the meshes collected and assign subMeshIndex 0 to the main and 1 to the rest. But I think the subMeshIndex of the CombineInstance is used for the source mesh, not for the union. https://docs.unity3d.com/ScriptReference/CombineInstance-subMeshIndex.html isn't very helpful imo. My hack: Create a CombineInstance[] for all accessories, combine them to 1 mesh, mergeSubMeshes = true. Create a second CombineInstance[] 1. main mesh, 2. accessories and combine those two without merging the submeshes. Feels bad though.
Answer by Blenderik · Mar 04 at 03:19 PM
Thes short answer is: use separate game objects. I would still like the long answer, though.
Your answer
Follow this Question
Related Questions
Are submeshes of combined mesh can share the same mesh instance? 0 Answers
Gather all the Meshes into 1 1 Answer
Merging meshes 0 Answers
Creating a submesh Unity 0 Answers
Does Mesh.CombineMeshes autosplit meshes over 64k triangles in Unity 5.x? 1 Answer