What is a submesh?


I’m sorry this is probably a very dumb question but: what is a submesh?
The unity docs weren’t very clear on this one…

anyway thanks!

Exporting an object with separate materials will give you separate submeshes. Such as in 3ds Max, you would apply different materials to either separate faces or objects as a whole. The polys sharing the same Mat on export will be grouped as a single submesh.

They appear as:

Element 0
Element 1
And so on.

If you want to check how many submeshes there are you can toss this code on (ignore the plural if it’s only 1 :P),

#pragma strict

function Start() {
		var mesh : Mesh = GetComponent(MeshFilter).mesh;
		Debug.Log(mesh.name + " has " + mesh.subMeshCount + " submeshes!");

Submeshes can be made in code as well… but I’d stick to dropping different materials down in the 3d software.