- Home /
Combine Skinned meshes
I have 2 different characters. Actually, they are not different and their animations are the same. How can I get two characters to use a common "root" object. I can't change the "Root Bone".
Answer by ugur_gok · Feb 28, 2021 at 11:30 AM
Thanks for your answer. @Bunny83 . I found the answer here. https://forum.unity.com/threads/prefab-breaks-on-mesh-update.282184/.
Answer by Bunny83 · Feb 28, 2021 at 11:13 AM
Even though your two characters / meshes may be similar or even identical, there could be differences in the bone array that is generated on import. As you know your bone structure is build up using usual gameobject hierarchy. However the SkinnedMeshRenderer does have a linear bones array which does the actual linkage to the bones. On the Mesh side you have the bindposes array which has a 1-to-1 correspondence to the bones array. This has to match or the skinning would be completely wrong. The final link on the Mesh side are the bone weights which link every vertex to a certain bone index. So when you want to combine two meshes that have a similar / same bone structure you want to find the corresponding bone in the target SkinnedMeshRenderer bones array.
It's not that easy but not too complicated once you understand how everything plays together. There has been quite a few questions on that topic in the past if you look for it. Here's one of those.
Your answer
Follow this Question
Related Questions
How to get the initial bone positions for a skinned mesh 0 Answers
Animation problem 0 Answers
Bones do not switch when called for (Find bones of player then replace clothes bones) 1 Answer
What space are the bones from an armature and the vertices of a mesh in? 1 Answer
Ragdoll on Only Part of a Model 2 Answers