I am evaluating Unity to see if it is suitable for our games.
We have built several skinned models with separated head, body, arms and legs sharing the same skeleton, and we have a single skeleton and a number of animations associate with it.
How can I set different head, body, arms and legs skinned models to the skeleton, and then apply those animations?
The simplest solution is to create those different skinned meshes with the same skeleton, and have them all attached to your character, but only have the ones enabled that you want to see.
A bit more advanced is to remove those parts that you don’t see.
Even more advanced is to combine at runtime the meshes you need into a single mesh (so you get fewer draw calls).
Just model a skeleton with X different meshes(head, torso, legs, etc) attached to it. Create every other character using that same skeleton.
Now after you import that model(with the skeleton and X meshes) you will end up with X skinned mesh renderers. You can attach any mesh to those renderers and it should work if they were created on the same skeleton. (Use SkinnedMeshRenderer.sharedMesh in a script to change the mesh).
But as Rune suggested, combining those meshes on the fly if probably the best solution performance wise. It should not prove too difficult apart from merging the UVs and the textures(something I haven’t tried yet, but I assume it’s not easy)
And I have try it on the editor, I can change different mesh within the skinned mesh renderer, but when I assign an animation to the original model, it work fine, but when I change the mesh and the animation seems cannot apply on the new mesh.
Am I miss something? or is it a bug? or is it cannot be done with animation?