change mesh clothes to the same character

Hi. How to change clothes for a character?

Okay, due to the lack of information you provided, this answer is going to be rather vague.

I assume clothing would be a texture and you can change textures by following the advise in many of the questions on this site.

Just do this:

renderer.material.mainTexture = yourNewTexture;

Found here: Changing an Objects texture. - Questions & Answers - Unity Discussions

If you wanted something more complex, i.e. add an object such as a hat or something that’s not part of the original object, you can create a new GameObject for it (obviously you’d need to instantiate the model of the hat first):

var hat : GameObject = new GameObject("Hat");
hat.transform.position = Vector3([add your own coordinates]);

Then just add the hat as a child of the player.

I think this is actually a good question. You can of course change textures, but it’s rather limited. You can also attach game objects as others have suggested, but they may not be animated properly.

I do as shadowriffe suggested:

  • I model each pieces of clothes in the same model file (blender), to include animation you need to make sure that the pieces of clothes are attached to the same armature than the model and correctly weighted
  • in Unity after importing my model, I just disable the mesh renderer for the clothes that must be hidden. Since the invisible parts are not rendered, performance is not affected.
  • when you play the animation, if the clothes were correctly weighted, they naturally follow your mesh

Please, to whom come still voting negatively: want you please to dismiss this nasty negative voting on me? What’s the culprit now?