I am trying to find a way to attach the camera to the head of my player. When I use SetupAttachment(GetMesh()); it locks to the feet of the mesh rotated 90 degrees and I cannot select a socket in the blueprint editor.
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)
That worked, thanks
Necro’ing this post to say THANK YOU @Nightjass
I’ve recently gone through a great tutorial to get UE source setup and to build dedicated servers.
I started following another tutorial, this time relating to FPS projects and I hit a roadblock in pinning the camera to a skeleton bone.
I figured it must be related to the code since the in-Editor files were marked as inherited and your solution above was exactly what I needed - had to make the edit diretly into the C++
Now I feel like my janky skills have levelled up, just a tiny bit!!
Thank you again!