How to turn a sprite in the direction of motion? (2D)

I am making a simple movement script that moves a 2D sprite either right or left based on “Horizontal” user input. I have the movement part down, however I also want the sprite to rotate to face the direction it is facing on the y axis while moving.

void FixedUpdate ()
{
float move = Input.GetAxis (“Horizontal”);

	//Moving left
	if (move < 0) {
		Debug.Log (move);
		if (transform.rotation == Quaternion.identity) {
			transform.rotation = Quaternion.AngleAxis (180, Vector3.up);
		}
	}

	//Moving right
	if (move > 0) {
		Debug.Log (move);
		if (transform.rotation == Quaternion.Euler(0.0f, 180.0f, 0.0f)) {
			transform.rotation = Quaternion.AngleAxis (180, Vector3.up);
		}
	}
	Vector2 movement = new Vector2 (move, 0.0f);
	rb.velocity = movement * speed;
}

I would love some help, rotation has been quite difficult for me.

transform.Rotate(new Vector3(180,0,0)*3);
this will get you started and use bool so you can turn only one when you press
some button so you don’t want to rotate to way’s on same button :smiley: