- Home /
change mesh clothes to the same character
Hi. How to change clothes for a character?
when you post a question be more clear with wat you want exactly, give details like wat kind of character, what kind of game. Also how to change clothes for a character doesnt make any sense.
what kind of model you have?? is it even 3d or jus 2d?!
I have a model done in LW/modo, it's a robot humanoid. the game's a soccer game Now why this "-1"?
Answer by danhanly · May 23, 2012 at 12:43 PM
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.
http://answers.unity3d.com/questions/40134/changing-object-texture-when-button-is-pressed.html
Just do this:
renderer.material.mainTexture = yourNewTexture;
Found here: http://answers.unity3d.com/questions/44634/changing-an-objects-texture.html
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.
It's difficult with such a vague question. It's akin to 'how do you cook?' and that depends on what you are cooking, whether you want it baked/fried/boiled etc. So many variables! I just spewed out as much as I could think of!
Hello. Thanks for the replies; the infos might come handy in case I'll encounter issues like these, but in this case I meant mesh clothes, such jackets and the like. Let's assume that the character should have a jacket in a first mission, and a trench for the second: should I craft a base character model per entire (I mean, a naked or almost naked model), upon which to put clothes, or it is enought to model just the visible naked parts (closed mesh? opened mesh?), then cover 'em with the clothes? And, in any case, how it's about when it will come to animations (mounting points? what?)? TY.
For the case you described with the jacket, i'd say just model all parts that will be visible in any outfit. You could even model everything in a single file (A .blend at least) and name each model "Jacket" or "Trench" etc. Then, in the unity editor, disable the mesh renderer for everything the character is not wearing, and write a script or simply toggle in the editor the mesh renderers to change what he/she is wearing.
^And in the above answer, if you have a skinned renderer with a rigged, animating model, you will want to find the gameObject that has the animation information and make your new item a child of that object:
hat.transform.parent = animationObject.transform;
@sympatik you should include the animation angle on a different question. I've answered how to change clothes. You should mark an answer as correct!
Answer by lyzard · May 24, 2012 at 06:47 AM
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
Hi. I understand by wide lines the process, albeit I probably lack some terms ("armature"?), due perhaps to the different methods and ter$$anonymous$$ologies between apps (I'm mostly with modo/lightwave, and I'm trying to catchup with max, albeit I don't like it so much...).
Answer by SympK · May 23, 2012 at 06:59 PM
Please, to whom come still voting negatively: want you please to dismiss this nasty negative voting on me? What's the culprit now?
Okay, I'm new to this community as well, so I'll give you a bit of advice. Questions like "Hi. How to change clothes for a character?"
don't work around here. Ins$$anonymous$$d, what you should have said, is something along the lines of "I have a character and I want to be able to change their clothes. It's a 3D game and the clothes I want to change into are going to be additional models to my character prefab. I can model the clothes, and the player, but I'm not sure how to combine the two on the tap of a button; also how do I then make it so when I move my character, the clothes come with him?"
This would show that you have made an effort with the question, and more importantly, we can help because we know exactly what you want, we can make several accurate assumptions about your scene/character setup and what kind of clothing you are referring to; you'll notice in my answer I catered for Texture based clothing i.e. changing a blue t-shirt to red, and model based clothing, i.e. adding a hat. This community can only help people who give enough information.
The reason people downvote, is to identify low quality questions, and in it's current state, your question is very low quality. Consider giving us as much information as we need to solve your problem and your reputation will grow. Those that have downvoted you may be convinced to remove the downvotes (or even swap for an upvote) if you revise the question to give us what we need to know.
This is not always true. For example, the prime downvote I got, it was 'cause I allegedly signed a question as "solved", whilst it wasn't yet; I tried to explain to the guy (prolly an ad$$anonymous$$?) that I hit accidentally the icon, asking him to remove the vote (if he's an ad$$anonymous$$, he could do it, I guess), but so far I didn't got any correction nor contact from him! I think this is very bad.
Your answer
Follow this Question
Related Questions
Character naked if camera gets too close 2 Answers
problem, characters, clothes 2 Answers
Adding Clothing to humanoid Character rig 0 Answers
Unity Clothes not working (Upgraded From Unity 2018.x.x.x To Unity 2019.x.x.x) 0 Answers
How do I model characters in Blender to account for swappable meshes? 1 Answer