Swap mesh parts i.e. attach one skinned mesh to another via bone

Hi all,

I have a character, say, a robot that is customisable. He has many different mashes for hands, feet etc and they are interchangeable and have their own animations and textures. I want to be able to attach a part to another part and still retain its own animation and textures but move according to its new parent transform. For example I have a torso skinned mesh and need to attach an arm at the shoulder bone.

I’ve seen examples where people say to have one whole animated skeleton and then make parts with the same bone names for that part and replace them but the point is that one hand may have a different animation to another hand, I just need to make sure that the shoulder bone of the arm is attached to the shoulder bone of the torso so that it positions itself accordingly.

I’ve tried setting the parent of the root of the arm to the shoulder transform of the torso but it doesn’t seem to position itself correctly and the animation on the arm stops working, I’m guessing as the animation file is now looking at a different bone hierarchy. Although the arm does seem to move relative to the movement of the torso as it animates.

Any ideas on how to achieve what I’m after?

Well what if the parts weren’t actually connected but instead on update the bone transform was set to the transform of the other i.e. the shoulder bone transform of the arm was set to the transform of the shoulder bone of the torso. Although doing this they really are separate meshes and I indeed wouldn’t be able to configure bone weights between the two…would I?

So am I left with taking the info of all meshes, stripping them down and building a new skinned mesh from scratch in code? I’ve seen this done but never done it myself, would there be a specific order I would need to add the vertices of all the associated limbs? And how would the separate animations and textures work on only the correct parts? My god why cant I ever try and achieve something easy?