I got a few questions about your code.
-
How do you know if it’s not attached? Remember that sometimes properties declared in C++ are not visible in Blueprints.
Try to change yourUPROPERTY(EditAnywhere)
toUPROPERTY(EditAnywhere, BlueprintReadWrite)
to visualize it on editor. -
Are you sure “GetMesh()” is initialized by the time you set up attachments to it?
May be something to confirm.