How do i make two diftent players always face each other?

I have made two different players that have separate axis and a what them to always face each other. I can get the x position from both players but i don’t know how to make them compare to each other in an if statement and flip the sprite because they are in different scripts.

I have no ide what to do if not to put both in the same script but then i cant make them move individually.

Need any help i can get thanks.

Vector3 _player1Rot = Player2.trasform.position - Player1.transform.position;

Vector3 _player2Rot = Player1.trasform.position - Player2.transform.position;

Player1.transform.rotation = Quaternion.Euler(_player1Rot);

Player2.transform.rotation = Quaternion.Euler(_player2Rot);

I think you need this, tell me if it did work