How to inherit physics velocity from attached character?

The sword you see below has a string, this is simulated on the physics asset by setting those particular bodies to be simulated (Physics Type = Simulated).

Physics simulation works fine when the sword moves via animation, but not when the character moves or looks around.


How do I fix this?

Weapon mesh is attached to arms mesh via the WeldTo() function (I also tried AttachToComponent())

Alternatively, should I do this another way? Maybe with cloth physics?

Ugh, nevermind. Just figured out I had a SetRelativeTranslation on my weapon’s Tick. That was causing the physics to reset.

Anyway it looks pretty weird when moving, so I’m probably going to change it to use cloth physics. When I do it, I’ll post it here whether that behaves better.

As for the attachment, this is the code to weld physics bodies (the last boolean in FAttachmentTransformRules).

Mesh1P->AttachToComponent(MyPawn->GetPawnMesh1P(), FAttachmentTransformRules(EAttachmentRule::SnapToTarget, EAttachmentRule::SnapToTarget, EAttachmentRule::KeepWorld, true), AttachPoint);