Struggling with how to use LookAt without adjusting along the Yaw

I’m just trying to get a character pawn to rotate towards the unit it’s attacking without factoring in the Y/yaw so it doesn’t angle up at targets that are larger than it. However I can’t get it to work for some reason.

Here’s what I have:

I can stop the yaw movement if I set it when setting the rotation but then I lose the Slerp. I’ve tried subtracting the yaw and I’ve tried limiting it when getting the lookAtRot. I can’t seem to get my character to rotate towards its target without also leaning along the Y/yaw axis.

Any assistance would be greatly appreciated.

The answer I found was to remove the Z axis from the locations used while finding the look at rotation. Forgot RotY = LocZ.

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