I’m setting up a modular character, using the default ACharacter skeletal mesh as the modular mesh’s “root”, and then attaching head, arms and legs to it.
sHead = CreateDefaultSubobject<USkeletalMeshComponent>(TEXT("Head"));
sLeftArm = CreateDefaultSubobject<USkeletalMeshComponent>(TEXT("Left Arm"));
sRightArm = CreateDefaultSubobject<USkeletalMeshComponent>(TEXT("Right Arm"));
sLeftLeg = CreateDefaultSubobject<USkeletalMeshComponent>(TEXT("Left Leg"));
sRightLeg = CreateDefaultSubobject<USkeletalMeshComponent>(TEXT("Right Leg"));
sHead->SetupAttachment(GetMesh());
sLeftArm->SetupAttachment(GetMesh());
sRightArm->SetupAttachment(GetMesh());
sLeftLeg->SetupAttachment(GetMesh());
sRightLeg->SetupAttachment(GetMesh());
After this, I setup the MasterPoseComponent
void AProtagonistCharacter::OnConstruction(const FTransform& Transform)
{
Super::OnConstruction(Transform);
GetMesh()->SetMasterPoseComponent(sHead);
GetMesh()->SetMasterPoseComponent(sLeftArm);
GetMesh()->SetMasterPoseComponent(sRightArm);
GetMesh()->SetMasterPoseComponent(sRightLeg);
GetMesh()->SetMasterPoseComponent(sLeftLeg);
}
This apparently works, but when I start the editor I get this warning on every tick:
LogTick: Warning: While processing prerequisites for SkeletalMeshComponent /Game/Maps/UEDPIE_0_EditorLevel.EditorLevel:PersistentLevel.BP_ProtagonistCharacter_C_0.Left Leg[TickComponent],
could use SkeletalMeshComponent /Game/Maps/UEDPIE_0_EditorLevel.EditorLevel:PersistentLevel.BP_ProtagonistCharacter_C_0.CharacterMesh0[TickComponent] because it would form a cycle.
This warning always points at the LAST skeletal mesh component I set in the OnConstruction method (in this case, sLeftLeg).
I honestly don’t understand this error at all and I have no idea what it actually could cause to my project. Also, it makes the output log unreadable.
I’m also open to alternatives to the MasterPoseComponent. In the Unreal Docs I’ve read that there are 2 other alternatives but I didn’t really understand what they do differently. I need this setup for a dismemberment system (which will also need to override the base locomotion animations when a body part is removed)