Why is SetupAttachment not working as expected?

I am trying to attach the camera boom from the third person C++ template to the character’s head. I created a socket called “firstperson”, and changed the code to the following:

CameraBoom->SetupAttachment(GetMesh(), TEXT("firstperson"));

I had trouble getting it attached to anything at first, but at some point it attached to the mesh properly, but it still won’t attach to the socket. Can someone please tell me what i’m doing wrong? I can’t find anything on this.

I have fixed it by using AttachToComponent in BeginPlay

1 Like

Thank you very much for this post. I spent almost an hour wondering why my components were not following their mesh!

No problem, glad I could help!