- Home /
Animate Clothing Meshes With Mecanim?
I'd like to know if it is possible to animate clothing meshes applied to a character using the same animations the character model uses via Mecanim.
Each clothing mesh (robes, armor, helms, leggings, boots) will be imported apart from the character and applied dynamically, but can be exported with all the same animations the character will have. How can I animate them to correspond to the Mecanim movements the character will make? Do I need to apply controllers to them and apply parameters such as "Attack1 = true" to all meshes needing animation, or can I get away with applying the controller to only the character?
Answer by jyyhope · Aug 26, 2015 at 12:44 PM
@ UberClocked Ent
This is the simple method for cloth and hair changing that works for me, though might not be the best way to do it or fit other models.
I got a humanoid avatar model .fbx that works with Mecanim, some clothes and hairs meshes in separate .fbx that matches up with this avatar (legacy as the model type when imported), all imported into Unity. My avatar has separate body meshes so that when I drag it (one .fbx) into the scene, different body part meshes can be seen in the Hierarchy along with the skeleton structure.
The cloth .fbx also has similar separate body mesh structure, for example chest mesh. Click on the chest mesh in the avatar will show component "Skinned Mesh Renderer". Pick the cloth chest mesh model to replace the original chest mesh in this component, so does the texture. Then the new cloth mesh directly works with the Mecanim animation that the avatar has.
For hair, it is rigid, so I just drag and drop the hair .fbx under the head skeleton in the avatar hierarchy. Then the hair moves with the head. There would be better solution for rigid parts that bounces or moves, like weapons. But this is the simplest way to change things that move along with the body parts, like hair or glasses.
All these should be able to be done via scripts as well.
Your answer
Follow this Question
Related Questions
Root motion / How to bake into pose Root Transform Position (x) 0 Answers
Character animation rotates wrong 0 Answers
Animate character sitting in a chair 1 Answer
character animation 0 Answers