Download

How to set AttachParent

I know now AttachParent is private, but how do I set it ?

AttachTo() should work fine.

I use SetupAttachment() for components

Yeah, by the looks of it, SetupAttachment() would be the better option for setting up the attachment parent of a component in a classes constructor.

From https://github.com/EpicGames/UnrealEngine/blob/release/Engine/Source/Runtime/Engine/Private/Components/SceneComponent.cpp#L1413



[TABLE="class: highlight tab-size js-file-line-container"]

if (ensureMsgf(!bRegistered, TEXT("SetupAttachment should only be used to initialize AttachParent and AttachSocketName for a future AttachTo. Once a component is registered you must use AttachTo.")))

       
       
         



Thank you @Larraz