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?
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.
@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.
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.