Attach camera to socket c++

Hi! I have sample third person project. I need attach camera to skeletal mesh socket.
I did so:

 FollowCamera = CreateDefaultSubobject<UCameraComponent(TEXT("FollowCamera"));
FollowCamera->SetupAttachment(GetMesh(), FName("headSocket")); 
FollowCamera->bUsePawnControlRotation = true; 

But it’s doesn’t working


What should I do?
PS: I’m created socket on mesh

If you check out this post, I would try AttatchRootComponentTo instead of SetupAttatchment

I checked that post. UCameraComponent haven’t method AttatchRootComponentTo

You could also try adding a SpringArmComponent first, and adding the camera to that. Check out the tutorial here