Animating characters with clothes

Hello!

I am running into an issue I can’t quite figure the way out. Basically, I have a rigged character I’m bringing onto Unity, and separate clothes I’m equipping on the said character and I want the clothes to follow the character’s movements. For example, say my character has pants and I’m animating his left leg, the left leg of the pants should move up with the character. How do I do that?

Character’s file is FBX which can support animations, though I’m building all my animations currently on Unity, I just want to make it work. Pants, however, are OBJ which I know they can’t bring animations with them but is there any way to do that through Unity and, especially, through code? If so, I’d need very accurate explanations, I’m kinda lost here. I can’t have the character with clothes before and then animate it (it would be probably much easier but I can’t do that in my case). So I import the character, and then clothes which go on the character and then I want to animate with everything following up correctly, using OBJ clothes designed on Marvelous Designer.

If it’s not possible, I’d need to find a way to rig the clothes (I don’t know how to do that either) automatically through a script which doesn’t seem like it’s been done before either.

Thanks!

What you are trying to do is not really advisable because it is unnecessarily heavy. A better way is to have your model with and without clothes and swap it out. Whatever the case you need a matching bone structure with properly skinned meshes. If you don’t have access to 3d software capable of doing this then download Blender and then look for information on “skinned meshes” and “joint deformations”

2 Likes

Exactly. RevoltingProductions is right. That will be heavy.

(If you know a bit of 3d modelling), I would suggest, that you take the nude/base
3d model, into a 3d modelling application, eg. 3ds max, blender etc.
And then extrude faces, from the characters body mesh and form from the body
the dress and skirt.

Then, add some bones to the dress parts, or animate the dress/clothes,
using key frames. And save those animations, so that they can be used, in Unity.

It might be a semi-tough process, but in the end, it might be worth it.

PS: Oh crap! I just realised, that you mention in your post, that you don’t know
how to rig clothes.

Well obj or not you need to skin the clothes to the skeleton in your 3d program, like any other deformable mesh. That tells each vert what bone to follow. That info cant be skipped. Its hard to tell from your post if you’re saying you don’t know how to do that. I’m afraid its not simple because clothing polygons sit close to the naked character’s polygons, and the slightest weighting difference in the wrong way will cause the meshes to z-fight (stuff pops through the clothes). Solutions would include making a version of the naked character with areas of polygons missing while wearing the clothing item. Its all very complicated to create a good character-customization system, I’m afraid.

Once you’ve done that you’ll find that if they’re not in the same fbx export file, they wont follow the same animation because Unity does not provide a built in solution. Every few days a frustrated animator has this same problem. The only way to get different fbx files to follow the same animation is to write a script that matches bone names between them and then copies the rotation and transforms. I’ve never done that but I hear its how its done.