Lock camera to head completely

I have this really cool flip animation and I wanted the camera to follow the head completely, like always look at the direction of the head at all times, I have it patented to the head bone but it still looks at the last direction I was looking before the animation, any suggestions? Thanks!!

Hi there,

Try this: add an empty actor to your level, renamed it, parent it to your character’s head, and reset its location and rotation. This actor is going to be used as tracking reference. Then, select your camera actor in the level outliner. Go to details panel and look for tracking. Set it as auto, then select actor to track as the empty actor.
Whenever player moves, so the empty actor attached to the head, and the camera will follow.

That should work.

1 Like

Hi, thanks for the response, but I don’t see a tracking option, maybe it’s called something else?

Hi there,

In UE4, is look at tracking settings. You’ll also need to do a focus settings as well.

Hope that helps.

I think I didn’t specify enough, I have a animation for a vault, for my parkour system, there’s one of 3 animal that does a cool barrel roll in the air, so it’s not a level sequence, and since the player camera responds to my mouse movement it’s really weird, the camera is parented to the head what I want to do is when I do the animation center and lock the camera so it goes with the barrel roll, thanks!!

Apologies, I misunderstood your question. You can find the node “get player controller” and call “disable input” right before playing the animation and “enable input” right at the end of if. In “pawn” option, “get a reference to self” do the trick.

Disable input is called from get player controller node (that green generic function, so there’s no need to cast to your actual controller BP, if any).

If you need to change camera location and rotation, you can get camera component and call “set relative location and rotation” before and after playing the animation. You want to adjust the values to fit your camera frame. Usually, after playing the animation, default values are (0,0,0) for location and rotation.

Don’t worry my explanation was pretty vague, I have disabled input so the player doesn’t go flying while vaulting already but the camera stays in the direction that it was while entering the vault, so I assume even if I put 0,0,0 it will stay looking at that dirección.

Hi there,

No worries.

So, before playing animation, you want to set the location and rotation values. It’s hard to tell, you’ll need to experient with the values for your use case.

Now, the values (0,0,0) for location and rotation are just “reset” values after playing the animation. I hope that makes sense.

I’ll try it later and get back to you thanks!

1 Like

Hey, thanks for your assistance, found a solution, just set “Use pawn control rotation” of the camera to false while the animation is playing it will completely ignore the player and follow exactly the parents movement!!
Thanks again.

1 Like