SetMasterPoseComponent does not update transform on physics enabled

Hello,

I have the following issue. When I use SetMasterPoseComponent on a second mesh to tie it to the master mesh, everything works perfectly in animations. However, when I enable physics on the master mesh, weird thing happens. The ragdoll info is still correctly passed to slave mesh, but his position and rotation (transform) is not updating any longer.

So to summarize:
When playing animation, no physics:

  • Animations update
  • Transform updates

5b23a2e34eb36c937be364330f5763651ed776e1.png

When physics enabled, no animation:

  • Physics affect model correctly (ragdolls match)
  • Transform is wrong (mesh is “stuck” in one position/rotation in world)

incorrect pos.PNG

Help pls!

Answering my own question. I forgot to attach the the slave skeletal mesh component to the master component as a child to inherit transforms. Missing code:




    		FAttachmentTransformRules rules(EAttachmentRule::SnapToTarget, EAttachmentRule::SnapToTarget, EAttachmentRule::SnapToTarget, false);
    
    		NewSkelMeshComp->AttachToComponent(comp, rules);