Yaw problem when try to lock an actor (3d sidescroller)

I ve got an issue about lock on target logic. I want the player lock an enemy and if it happens, player shouldn’t turn back to enemy. This is the same logic in 3d games, player lock an enemy and it is always face to enemy.
normally, character yaws with controller but in this state, I want to player walk forward and walk backward when it locks.
So here are blueaprints and a video
Thank you


This is what the ‘lookatrotation’ node is for:

I’m not sure it that’s right for you, in semi 2D, but something along those lines maybe…