Problem with inconsistent skinning

Hello everyone,

Given two identical skeletons (A and B, being A is already skinned), I am trying to instantiate a copy of the mesh skinned with skeleton A, and skinned to skeleton B. Both skeleton hierarchies are the same, but are animated differently.

It skins properly. However, when the character moves at high speeds (e.g. rotates fast), there are the following artifacts. It’s like the skinned bones do not rotate and connect well.

This is the method that I wrote to skin the skeleton:

// The skin I want to copy from
public SkinnedMeshRenderer skinnedMeshRendererSurfaceA;

//  Root of skeleton A
public Transform skeletonA;

// I use this for other purpose explained later
public List<Transform> bonesCorrectOrder;
public Transform variableArmature;

private void SkinningSkeleton()
    {
        // Create an instance of SkinnedMeshRenderer (B)
        SkinnedMeshRenderer skinnedMeshRendererSurfaceB;

        // Make the copy of A
        skinnedMeshRendererSurfaceB= Instantiate(skinnedMeshRendererSurfaceA, this.transform);

        // Only make visible B
        skinnedMeshRendererSurfaceA.enabled = false;
        skinnedMeshRendererSurfaceB.enabled = true;

        // I can't attach directly the list of bones from the hierarchy to skinnedMeshRendererSurfaceB.bones, since they had different order. Therefore, I need to rearrange the bones from the hierarchy following the order of skinnedMeshRendererSurfaceA.bones.
        foreach (Transform tfm in skinnedMeshRendererSurfaceA.bones)
        {
            bonesCorrectOrder.Add(TransformDeepChildExtension.FindDeepChild(skeletonA, tfm.name));
        }
      
        // Assign new root
        skinnedMeshRendererSurfaceB.rootBone = variableArmature.GetChild(0).transform;

        // Assign array of bones
        skinnedMeshRendererSurfaceB.bones = bonesCorrectOrder.ToArray();

        // Assign material
        skinnedMeshRendererSurfaceB.material = skeletonMaterial;
    }

Should I perform other operation to skin the skeleton properly? Or do you have any hint why these artifacts are happening?

Thank you!

Hello,

Does anyone know what it could be happening? I did not found a solution yet.

Thank you!