Attach bone to bone

Hello. Is there a way to interact between two skeletons? For example, so that the character can detach the magazine from the weapon or switch the shooting mode. There are options?

// On your actor, get a component (in this case root):
GetRootComponent()->AttachToComponent(InAttachmentParent, FAttachmentTransformRules(InLocationRule, InRotationRule, InScaleRule, bInWeldSimulatedBodies), InAttachmentSocket);

// A primitive component is also a skeleton
InPrimitiveComponent->GetAllSocketNames()

If the question is for blueprints, search for the “attach to component / socket” or similar methods

Thanks!