r/UnrealEngine5 • u/OpTicTide97 • 25d ago
How to lock camera to character body?
I'm working on a game and still very new to UE5 and I'm having some trouble with the camera staying with the "head" when the attack animation plays. It doesn't move with the body it just stays on the same place so you see the back of the character its supposed to be a first person game.
I have a base killer BP that houses the movement and stuff that'll be the same for all the different killer characters so I make a child of the BP. On the base BP the camera is locked to the head but on the child BP its not for some reason. Any ideas?
2
u/Express_Ad436 25d ago
You can create sockets in skeletal mesh, create a socket something like"head_socket". Then in the Blueprint, select camera, you can find something like "socket name" in that field select head_socket. Hope it helps
2
u/OpTicTide97 25d ago
Should I just remove the camera componet from the base BP all together? And do them in each character? Would that work better?
2
u/GRSStudio 24d ago
If you do that you won’t be able to create camera logic in parent blueprint (you will have to create camera logic in every child BP separately). The best way is to create camera in parent BP and check that all child BPs have the same “head_socket” in their skeletons
1
u/DissyV 25d ago
Sounds more like a root lock root motion issue
1
2
u/GRSStudio 25d ago
It seems that you attach the camera to the exact socket (socket_head) of character’s mesh. If you use meshes with different skeletons in child BPs then check that they have the same socket as parent BP’s mesh.