attach camera to socket

I am working on the third person c++ example project.
I have created a Socket on Unreal Engine’s Default Mannequin.
I have named it “Socket_Head” its attached to the Head Bone Skeleton of the Mannequin.

I have a default Character class named DarkHuntCharacter which uses Mannequin for a Mesh
This Class also creates a boom and camera from default third person c++ Example

this line of code. CameraBoom->AttachTo(RootComponent);
but instead I want to connect it to my socket I have Created.
how can I change this line of code to connect to my socket instead.

There is an AttachSocketName on SceneComponents that will attach things to the socket of their attachparent, so you’d attach the camera to the mesh and then change the AttachSocketName to your socket.

You can also set this in your BP in the editor under the details panel of your camera component.