Player character moves in spiral pattern when strafing around locked-on target

Hi all! I’m making an FPS in UE5 where the player can lock on to targets, similar to Metroid Prime. The lock-on is achieved by setting the player controller’s Control Rotation to the Look At Rotation between the camera’s location and the target actor’s location. I am lerping the rotation, but the problem I’m about to describe persists even when I skip the lerp and set the Control Rotation directly.

Here’s the problem: when I strafe around my target, instead of moving in a circle as expected, the player character gradually moves backward away from the target, forming a spiral pattern. This happens even faster if you set a higher movement speed.

I’ve found a few relevant threads on Reddit and here on the UE Forums, but the replies suggest adding an offset to the actor location while strafing to compensate for the drift. As far as I can tell, they recommend a brute-force approach to finding the correct offset for your movement speed.

However, if your character can both walk and sprint, you would need to find two offsets and apply them depending on whether the player is walking or sprinting. It gets even more complicated if your character can do a short-range dodge/dash maneuver.

My first question is: why does this happen at all? I would expect, if my control rotation is locked to my target, strafing would move me in a perfect circle around the target.

My second question is: what other solutions exist? Can I clamp my player’s movement to a circle around the target so long as there’s no input on the Y axis? Can I programmatically derive the exact offset required to maintain the same distance from the target (again, so long as there’s no input on the Y axis)?

I’m relatively new to Unreal and brand-new to the forums, so please let me know if I’ve neglected to include any information. I’ve attached a screenshot of my Lock Camera function below—it’s called on the built-in Look input axis events so long as the player is locked on to a target. The code is from this tutorial. Thanks!

The cause of the spiral is the random timing between strafe lateral movement and when the rotation is applied. To get this to be perfect without spiraling in either direction (inward/outward) you’d have to apply a very specific strafe distance movement, then immediately apply a specific rotation.

The only “Off the Top of my Head” solution I can think of at the moment is using a Physics Constraint or Handle to lock the Pawns distance.

In this case, neither actor (the Player or the Target) have Simulate Physics enabled. Would a solution using Physics Constraint or Handle work here?

My engineer friends suggested a math-heavy solution that I’ve almost got working, but I imagine a built-in constraint would be more performant. I’ll be out this weekend, but I can share an update on my progress when I get back on Monday.

plz i’m in urgent need of your help Can you post blueprint how did it
thank you