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

Hello,
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

https://drive.google.com/drive/folders/1HBrrerWu9Jiau2Mtvxb8FMtG87fQo_ma?usp=sharing

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…