How to stop rotation in x and y axis???

Im making a 2D game and don’t want the obkects to rotate in the x and y axis’s
This is my movement code so far

transform.right = player.position - transform.position;
        transform.position = Vector3.MoveTowards(transform.position, player.position , speed * Time.deltaTime);

Instead of transform.right, maybe use transform.position.x instead

@wertyq Ahh there is a component called Rotation Constraint and you can stop it rotating on the x and y axis. However know my enemy will flip over which I do not want .