SubobjectData->SetupAttachment uses NAME_None and ignores SocketName parameter

Hello,

We’ve been trying to get an editor utility working to create and attach subobjects to specific sockets on an actor, but could not get the subobjects to attach to the correct sockets. FSubobjectData->SetupAttachment is being used to achieve this, but after a closer inspection in the code, I noticed that the SocketName parameter is never used and instead uses NAME_None to set up the attachment. I’ve fixed this locally for now, but thought it was best that you were aware of the issue.

Thanks,

Bonita

In Subobjectdata.cpp line 578 -

`void FSubobjectData::SetupAttachment(FName SocketName, const FSubobjectDataHandle& AttachParentHandle)
{
USceneComponent* SceneComponentTemplate = Cast(GetMutableComponentTemplate());
if (!SceneComponentTemplate)
{
return;
}

FSubobjectData* AttachParentData = AttachParentHandle.GetData();
USceneComponent* AttachParent = AttachParentData ?
Cast(AttachParentData->GetMutableComponentTemplate()) :
SceneComponentTemplate->GetAttachParent();

SceneComponentTemplate->SetupAttachment(AttachParent, NAME_None);
if(USCS_Node* SCS_Node = GetSCSNode())
{
SCS_Node->Modify();
SCS_Node->AttachToName = NAME_None;
}
}`

Steps to Reproduce

Hi Bonita,

Thank you for the report. I’ll file an internal bug report and provide you with a public tracker link soon.

Best regards,

Vitor

Here’s the bug tracker link: UE-273422. It should become accessible once the engine devs mark it as public.

Also note that there is a function FSubobjectData::SetSocketName() which you can use to overcome this problem without having to edit the engine code, if this is of any help.

Best regards,

Vitor