Hey all, I am wondering if there is a way within Unity's editor to assign different materials to different regions of the same mesh. Say for example I have a character and I want the upper body to have one material and the lower body to have another. I can accomplish this right now in Maya by assigning different materials to different faces, but I would potentially like to do this within Unity instead. Thanks!
2 Answers
2The Unity editor don't have a UI for that, but it is possible to do from a script. You need to setup submeshes for each material. Take a look at SetTriangles.
The second solution would be to break up the mesh into multiple meshes. That way you can assign a material to each mesh since they are seperate meshes.
I don't know, maybe someone have already written an editor script that provides an UI for the first case.
As Bunny83 said you have to have as many submeshes as materials (and you have much more control when you split the geometry in Maya).
If you want to keep your model as one mesh (because of skinning etc.) you could try to create one material for the whole object e.g. by using a texture atlas. You could also use a Shader which is using a second texture or Alpha texture to gain different visual appearances.
OK, I'll check that out. In general I want to avoid splitting our characters into multiple pieces as that will make skinning more tedious.
– anon35392191