Hi.
I currently use SetMasterPoseComponent() to easily implement weapon anims.
This is my current code which gets executed when equipping the weapon (simplified):
Mesh1P->AttachToComponent(Pawn->GetMesh1P(), FAttachmentTransformRules::SnapToTargetIncludingScale);
Mesh1P->SetAnimationMode(EAnimationMode::AnimationBlueprint);
Mesh1P->SetAnimInstanceClass(AnimInstanceFP);
if (Mesh1P->GetAnimInstance())
{
UTOWeaponAnimInstance* ai = Cast<UTOWeaponAnimInstance>(Mesh1P->GetAnimInstance());
if (ai)
{
ai->Weapon = this;
}
}
Pawn->GetMesh1P()->SetMasterPoseComponent(Mesh1P);
I also set Mesh1P->bUseAttachParentBound = true because otherwise sometimes the weapon does not attach to the hand. (when moving out with the cam after depossessing the pawn in the ed it gets attached on a certain distance).
I am getting this log which does not get printed when I did not use SetMasterPoseComponent:
[2018.01.09-][827]LogTick: Warning: While processing prerequisites for SkeletalMeshComponent /Game/Maps/MAP-Scope.MAP-Scope:PersistentLevel.P_Terr_Male_Medium_C_10.CharacterMesh1P[TickComponent], could use SkeletalMeshComponent /Game/Maps/MAP-Scope.MAP-Scope:PersistentLevel.Weap_Glock_C_21.WeaponMesh1P[TickComponent] because it would form a cycle.
Is this a bug or how could I solve this problem?
When playing everything is behaving like it should be (while spamming the log).