How to do a smooth rotation of the character

I’m making a infinite runner. My character is already moving forward by itself.

This is the code i have to the rotation (on Update):

moveDirection.x = Input.GetAxisRaw (“Horizontal”) * runningSpeed;

	if (Input.GetKey (KeyCode.LeftArrow)) {
		transform.eulerAngles = new Vector3 (0, -45, 0);

	if (Input.GetKeyUp (KeyCode.LeftArrow))
		transform.eulerAngles =;

	if (Input.GetKey (KeyCode.RightArrow)) {
		transform.eulerAngles = new Vector3 (0, 45, 0);

	if (Input.GetKeyUp (KeyCode.RightArrow))
		transform.eulerAngles =;

Now, what i would like to see is making the rotation smooth. I don’t understand quite the Quaternions.

Thanks, in advance!

transform.rotation = Quaternion.Lerp(
Quaternion.Euler(0, 1, 0), //change for different rotations

That should work

you can find solution: