2D enemy rotate to player with Vector2.MoveTowards

Hi, I have this method to make the enemy follow the player in 2D but I cannot get the enemy to rotate to the player

 transform.position = Vector2.MoveTowards(transform.position, new Vector2(player.position.x, transform.position.y), moveSpeed * Time.deltaTime);

how can I make the enemy rotate to the player with this method or if there is another method that will be ok

 var dir = player.position - transform.position;
            var angle = Mathf.Atan2(dir.y, dir.x) * Mathf.Rad2Deg;
            transform.rotation = Quaternion.AngleAxis(angle, Vector3.forward);
3 Likes