Quaternion look = Quaternion.LookRotation(player.position - transform.position);
transform.rotation = Quaternion.Euler(look.eulerAngles.x, 0, 0);
I simply want my object to look at the player object only on the X axis. Try the script out yourself. Once it gets to 90 degrees it stops trying to look towards the player object.