What I did was make a cube in Sketchup, set each side with a different material, exported as 2-sided FBX, imported to Unity. As expected, there are 7 materials (one for each exterior face and one for the 'inside' faces). And 24 triangles (2 per face, and 2 sets of those per side of the cube (exterior and interior). I examine the triangle index from the raycast hit, and using Scrooge's script, find the submesh. The index I get does not correspond to the order a that materials are listed in the IDE. So is there something I'm missing, is there a hidden API or member that maps submesh to material?
asked Aug 01 '12 at 12:03 AM
i'd check it right now. submesh index and material index are the same. both are zero-based. if you get another result somewhere - show us example.
answered Aug 01 '12 at 05:35 AM