SetFocus ignoring Z axis when target is a TargetPoint

Hey, I’m trying to make my enemies look and shoot at my character’s head using SetFocus.
Previously I just did SetFocus with the player character as the target, but that makes the enemies look at the center of the character (However besides that it worked just fine).

To make the focus the player’s head, I added a child actor with the child actor class as TargetPoint, and used that actor as the focus. Now the enemy focuses on the player’s head, but only on the XY axes, and just ignores the Z axis. Another thing to note is that when I print the actor location before setting it as the focus, the Z value does match that of the player.

(P.S. I know I can use setFocalPoint and update it on every tick, but I would really rather not)

What am I doing wrong? Thank you :slight_smile:

This is the function I use for setting the focus

This is what happens when I set the TargetPoint as the focus

This is what happens when I set the actor itself as the focus (yellow line is the focal point of the enemy)

Hey @WEASELS how are you?

Wha I think you want to do is to make the enemy’s weapon point at the player’s head and I assume you want the enemy to move only its upper body while doing that.

For that, I highly recomend you to follow this tutorial, which will help you to implement that feature!

You can mix your code with this tutorial to make the enemies look at player even on Z axis!

Hope this helps you!

Hey, thank you - unfortunately the way in the video is done via event tick, and I’m trying to avoid that, so that does not work for me