FSkeletalMeshMerge doesn't animate correctly

FSkeletalMeshMerge is producing the desired combined mesh but the mesh doesn’t animate as intended

I’m using the following code:

.h

#pragma once

#include "CoreMinimal.h"
#include "Components/SkeletalMeshComponent.h"
#include "SkeletalMeshCombined.generated.h"

UCLASS(ClassGroup = (Custom), meta = (BlueprintSpawnableComponent))
class MYGAME_API USkeletalMeshCombined : public USkeletalMeshComponent
{
	GENERATED_BODY()
	
public:    
	
    UPROPERTY(EditAnywhere)
    TArray<USkeletalMesh*> MeshesToCombine;
	
    virtual void BeginPlay() override;
};

.cpp

#include "SkeletalMeshCombined.h"

#include "SkeletalMeshMerge.h"

void USkeletalMeshCombined::BeginPlay()
{
    Super::BeginPlay();

    if (GetOwner() == nullptr)
        return;

    if (MeshesToCombine.Num() > 0)
    {
        TArray<USkeletalMesh*> mergeMeshes;
        mergeMeshes.Empty(MeshesToCombine.Num());

        for (int32 i = 0; i < MeshesToCombine.Num(); i++)
        {
            if (MeshesToCombine[i] == nullptr)
                continue;

            mergeMeshes.Add(MeshesToCombine[i]);
        }

        if (mergeMeshes.Num() > 0)
        {
            USkeletalMesh* targetMesh = NewObject<USkeletalMesh>(this, FName("MergedMesh"), EObjectFlags::RF_NoFlags);
            TArray<FSkelMeshMergeSectionMapping> sectionMappings;
            FSkeletalMeshMerge merger(targetMesh, mergeMeshes, sectionMappings, 0);
            const bool mergeStatus = merger.DoMerge();
            check(mergeStatus == true);

            //Set the skeleton for the combined mesh
            targetMesh->Skeleton = mergeMeshes[0]->Skeleton;

            //Use the new combined mesh
            this->SetSkeletalMesh(targetMesh);
        }
    }
}

It produces this mesh:

But it looks like this when animating:

I might be using FSkeletalMeshMerge incorrectly but this seems like a bug.

Any ideas on what might be causing this?

Hello,

We’ve recently made a switch to a new bug reporting method using a more structured form. Please visit the link below for more details and report the issue using the new Bug Submission Form. Feel free to continue to use this thread for community discussion around the issue.

https://forums.unrealengine.com/unreal-engine/announcements-and-releases/1410408-unreal-engine-bug-submission-form

Thanks

I spend 2 hours making a stripped down project to upload with it. I’ve submitted it there but I don’t have a confirmation email and it doesn’t show up when I search for it.

Are you able to confirm it went through?