[C++] Socket attachment change not updated in BP

Hi, I had a problem where SetupAttahment to a socket doesn’t work in my case I wanted to attach the Camera to the character’s head using SetupAttachment(GetMesh(), FName(“head”)) in the constructor but it didn’t seem to work at all, I’m using a Blueprint class derived from a C++ class, I tried to do the attaching in the BeginPlay event and it worked just fine, but after some testing it turned out that if you’ve already created the object in my case a UCameraComponent and you didn’t specify a socket the first time you can no longer change or remove the attachment socket. (You can but it won’t be updated in the blueprint class)

To reproduce just use the third person C++ template add a new UCameraComponent and set the attachment without indicating a socket like this: myCamera->SetupAttachment(GetMesh()); then compile.

Now go back and edit the attachment instead of myCamera->SetupAttachment(GetMesh()); we want myCamera->SetupAttachment(GetMesh(), FName(“head”)); after you compile this you’ll notice that the change didn’t take effect.

However if you change the name of the component CreateDefaultSubobject(TEXT(“NEWNAMEHERE”)) you can force the update and you should see the change.

Same problem if you created the UCameraComponent the first time and indicated a socket, you can no longer go back and change or remove the socket name you can compile but the change will not be reflected in the blueprint class.
(Tried this with two projects same problem)