Rotating an actor to point at the player, yaw, pitch, and roll

I currently have a turret actor in my project that can rotate around left and right (Z axis) to follow the player’s movement. However, when it comes to handling up/down, I keep running into problems.

I can get it to correctly track the player’s vertical location over about 90 degrees of rotation (on yaw). After that, it points the opposite way I want it to (down instead of up, for example) before slowly pointing back towards the character as I run around it. I know it has something to do with the “Find Look At” rotation’s yaw/pitch values being positive or negative as my character moves about, but I haven’t been able to wrap my head around how to account for this.

Does anyone have a working solution for this that they can share, or at least a pointer in the right direction (no pun intended)?

How do you calculate this rotations?

Use vectors. Get turret location and player location, then calculate direction:

Direction = Normalize(Get turret location - player location)

Now you can calculate rotator from direction

rotation = MakeRotFromX(Direction)

Thats all.