C++ Lock camera to head bone

Hi DifDirection.

In c++ you can try this.

CharacterCamera = CreateDefaultSubobject<UCameraComponent>(TEXT("CharacterCamera"));
CharacterCamera->SetupAttachment(GetMesh(), "head");
CharacterCamera->bUsePawnControlRotation = true; 

You cannot change parent socket in editor menu if component inhherited from C++. Add camera in editor and delete from C++ or use AttachTo in blueprint.
Hope, this is helpful for you)

3 Likes