C# 2d movement rotation script

so , im trying to get my character to rotate in order to look at the right direction but I cant seem to find a solution…
Also I know that i should evolve rotationSpeed or rotationSmoothing but I dont know how

using UnityEngine;
using System.Collections;
 
public class Player_movement : MonoBehaviour
{
    public float speed;
	public float currentSpeed;
    public float jumpSpeed;
	public float runSpeed;
    public float gravity;
	public float rotationSpeed;
    private Vector3 v3_moveDirection = Vector3.zero;
    private CharacterController controller;
 
void Awake ()
    {
       controller = GetComponent<CharacterController>();
		currentSpeed = speed;
	}
 void Update ()
    {
		       if (controller.isGrounded)
       { 
         v3_moveDirection = new Vector3(Input.GetAxis("Horizontal"), 0, 0);
         v3_moveDirection *= currentSpeed;
 
         if (Input.GetButton("Jump"))
         {
                v3_moveDirection.y = jumpSpeed;
         }
		 if(Input.GetButtonDown("A"))
			{
				transform.Rotate(0,180,0);
			}
			 if(Input.GetButtonDown("D"))
			{
				transform.Rotate(0,180,0);
			}


				 
		  if(Input.GetButtonDown("Run"))
			{
				currentSpeed = runSpeed;
			}
		    if(Input.GetButtonUp("Run"))
			{
				currentSpeed = speed;
			}	
       }
 
       v3_moveDirection.y -= gravity * Time.deltaTime;
        controller.Move(v3_moveDirection * Time.deltaTime);
    }
 
}

thats my code…
thanks in advance

You are not understanding the function rotate well enough. It looks like you are assuming it to flip, 180 degrees on btn pressed. If you want that, use eulerAngles(). Otherwise, Rotate requires time, a single axis (in your case).

I still don’t quite get it…I cant get it working , if the player is walking in one direction by pressing A and the stop and press A again he will keep moving left while he is facing the other side…

use lerp. thats what im using on my 2d game

transform.position = Vector3.Lerp(startMarker.position, endMarker.position, fracJourney);

http://docs.unity3d.com/Documentation/ScriptReference/Vector3.Lerp.html