Lock Player, so he is always facing the Enemy in 3d mobile

Hello everyone,
I have been trying this for some time and have not found anything on the internet about it.
How is it possible in a 3d mobile game to lock a player so that he is always facing the opponent, so you can’t look around. (Like in a boxing match - you always move proportionally to your opponent).
Thanks for sharing your Ideas

See Cinemachine package, its tutorial and videos and also “Look At” property.

You can script this stuff by yourself too, if you want to.

When you are rotating camera around the player, it is probably storing “yaw” angle somewhere which determines what it is looking at. Use trigonometry and atan to override yaw.when camera is locked.

Also, same can be done through vector math.

You can find a direction vector from the player towards the enemy by taking the enemy’s position and subtract the player’s position. Then you’d need to normalize the result. Then you can set the players forward vector to that result.

Although, you may not want to set the direction directly, because that might present a jarring view to the player. You probably want the direction to be a target direction and somehow tween the players direction.