Is there a way to make an NPC look at the camera IN AN ANIMATION?

Hello all!

I’m working on a first person horror game, snd I have a dead body that comes to life when the player gets close.

It’s basically just a trigger box that triggers an animation sequence.

But I’d like to trigger it from different angles, and that no matter where the player camera is positioned, the character would look right at it during the animation sequence.

I saw many tutorials on how to make an npc look at the player, but none on how to do it while running an animation.
Is it even possible?

I’d appreciate any of your input or advice!

Thank in advanced!

Hi, Raz,

A couple of questions:

  1. Does the character use an animation blueprint or is it just a skeletal mesh with basic logic?

  2. To be clear, you want only the HEAD of the character to turn and face the player/camera?

Hi @Leomerya12

The character uses an animation asset.

It’s not just turning of the head, there’s body and arms movement as well. In the animation it turns the head to the side, but I wonder if I can make it look at the camera wherever it may be…

To trigger it, when the player overlaps the trigger box, I just trigger it from the level blueprint.

Is there a better way of doing something like that?

@Leomerya12
Just to give even more context - the reason I went for this method is because it really is just a jump scare. It’s basically just a static mesh that comes to life for a few seconds, moves around, then flops back into being a static mesh.

So I figured I can just have it paused on the first frame of this animation, then trigger it to play once when the player enters the trigger box. And that’s it. No more animation is required.

And for this, it works perfectly. The only problem is, if the player doesn’t stand exactly in the character’s eye sight, it looks a bit silly. So I want him to turn his head when the animation is running, to wherever the player camera is.

I believe I better understand.

The animation contorts the body, however, you want the head to move independent of the rest of the animation.

The reason I asked if you’re using an animation blueprint is because, well, that’s what you’ll have to use.

You would use a SLOT that will basically play the lower half of the body (as a montage), and then you would get the LOOK AT ROTATION for the head bones.

Here’s an example for dividing the body into sections:

It’s quite a bit of work to explain what to do here, however, if you substitute the head bone(s) for the upper body as a whole, you’ll get close to what you’ll need.

Again, you would retrieve the bone and use the LOOK AT ROTATION to align the head with the target.

Thanks, @Leomerya12 ! That put me on the right track!

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.