Assigning a clothing object to a character's skeleton?

I am trying to do an equipment system where there are interchangeable clothing items that get instantiated onto the player as they are equipped, as is standard in most RPGs. So far I’ve got the position of the clothing after they’re instantiated fine, but I can’t figure out how to get the clothing to animate.

I’ve read that I should set the root bone of my clothing object’s skinned mesh renderer to the root bone of my character. However, that seems to only allow the transforms of the root bone that I assign (the “hips” bone in this case) to actually affect the mesh. Sometimes it even causes weird offsets in the position of the mesh as well. I’m hoping I’m just misunderstanding something here, because I can’t understand why it wouldn’t work. Both the character and the clothing mesh were made with the same skeleton.

Am I going about this in the wrong way? There are only two other options I can think of. Copying all of the character skeleton’s transforms to a skeleton that is on the clothing object (or parenting the clothing’s bones to the character’s), but that seems fairly complicated and inefficient. The second one being to play the same animation on each clothing object. That would mean having multiple skeletons animating at the same time, and wouldn’t that cause a bit of a performance hit?

Been frustrating the past few days trying to figure this out with everything else in my game going relatively smoothly, and maybe I’m just overthinking it. Just thought I’d ask here for advice before I bite the bullet and just go with option #2 that I listed.

This UA thread explains how to map the bone array from the clothing mesh to the cahracter mesh:

Shared skeleton and animation state

I’ve created a temporary workaround for parenting a clothing’s skeleton to the character’s, however it isn’t ideal as I haven’t figured out a way to find bones automatically.

I set up a script that contains Transform variables for each bone on the character,

        using UnityEngine;
        using System.Collections;
        
            public class CharacterBoneList : MonoBehaviour {
            
            	public Transform Hips;
            	public Transform Spine;
            	public Transform Chest;
        .
        .
        . etc for each bone
}

then call ParentClothBoneToChar () from a script attached to the clothing item that has variables for each bone as well:

        using UnityEngine;
        using System.Collections;
        
    public class ParentClothBoneToChar : MonoBehaviour {
    
    	public Transform clothHips;
    	public Transform clothSpine;
    	public Transform clothChest;
    	...etc

        
        	public CharacterBoneList charBones;
                    public void ParentBonesToChar () {   		     charBones=GameObject.Find("Player").GetComponent<CharacterBoneList>();
                    
                    		clothHips.SetParent (charBones.Hips);
                    		clothSpine.SetParent (charBones.Spine);
                    		clothChest.SetParent (charBones.Chest);  
                    .
                    .
                    . etc, for each bone.
}
}

Of course this means having 4+ skeletons on each character since you need one for each article of clothing. I know that bones in Unity are simply GameObjects, but having over 4x than what is needed seems a bit inefficient to me.

I found the answer! The clothing mesh needs to be skinned to the rig and imported along with the fbx.