Rotation doesn't turn towards characters on right

So I’m working on a tower defense type of game and I have a rotation set up that is supposed to follow a chosen enemy. What I’m seeing is when the enemy comes from the left the turret turns quickly to face the enemy quickly. But when the enemy is on the right it goes much slower and doesn’t actually “face” the character until much longer.

In this image I have the game set to show the capsule when the enemy is “targeted” so I know which one the turret is supposed to be facing.Right now its set for closest to base so the enemy at the bottom of the circle is the one the turret should be aimed at. It had from the time the enemy entered the blue area from the right till now when its almost out to point at the enemy. But it still hasn’t completely turned to point at the enemy yet. However when the closest enemy is on the left it has no problem turning to face the enemy quickly.

Here is the code I am using to turn towards the enemy. Any ideas on what could possibly causing this behavior?

You sure you have the right axis for this rotation? Game looks 2D and you are only using the “y” axis pitch but have you tried just hooking the “look at rotation” in directly to the set rotation node? Also there are multiple enemies with their “capsule” component showing, are you sure it is targeting the one you think it is at the time you think it should be targeting them? This runs on tick so, things can change pretty quick. How do you set “targeted enemy”?

Yes I’m not hiding the capsule when the enemy is no longer targeted. I’ll try play around with what you suggest and hide the capsule when it’s no longer targeted and I’ll see if that changes anything.

Are there any settings in a character that would maybe cause issues like this?

Not sure, also, have you tried using the “yaw” (z-axis" for the rotation). The y axis isn’t usually the one you change for rotation like that, it “tilts” the player up and down, like to look at the ground vs the sky. Z axis is usually the one for “spinning” movements.

I’m wondering now if this is intended behavior as when reading some of the docs they say it performs calculations to avoid some common movement issues. So maybe its intentionally doing this because of the direction the enemies are coming from and moving towards the turret it moves slower because of it. I don’t think its the end of the world as it eventually gets there. Just seems odd.

I’ve tried all the axis one at a time and the y axis is the only one that makes the turret spin without flipping over.

Have you tried using the Lerp Rotator node. It lets you specify that you wish to use the shortest path. It doesn’t work well with delta time but I’m sure you can figure it out.

So I fixed it by setting the X and Y coordinates to the X and Y values from the turrets current rotation and that seems to make things work a lot better. Here is the updated code that seems to work better now.