How to make only-head rotation in UE4?

I’ve made a character, attached a camera to it and setted input. But now i want only character’s head to rotate with mouse, but not a whole character (player capsule rotates with Q and E keys). I tried to attach camera to head socket, but it doesn’t work (i think it’s a wrong way). How can i do it on C++? Thank you!

P.S. I know, that it’s a stange idea (control like this will be uncomfortable probably), but it’s my work-task and i find it very intersting.