Correcting a rotation that looks at other object

I wanted an object of an enemy to rotate into the direction of the player (2D)
I’m currently using this code:

transform.right = playerGO.transform.position - transform.position;

But, it always endup rotating 90 degrees more than it should. what should I do?

If you want an object to look at a target you can use the following;

transform.rotation = Quaternion.LookRotation (playerGO.transform.position - transform.position);