Lane moving vehicle

I am making a endless runner game, just to practice, because i am new to Unity, and i haven’t finished any project yet, and i want to make a custom character controller for my vehicle. The game is simple, you are in control of a car, and there are two roads.

I want to make something like a lane moving controller, so that when the player press “A”, the car automatically moves to the left side of the road, and when the player press “D”, it moves to the right side of the road, but i don’t know much about character controllers and those things. Actually, could i make a animation system or something? All that i want is to make a “lane moving vehicle”

Well, I don’t know your script, so I don’t know what type of car controller you’re using. (Wheelcolliders, pure physics, etc) but you could try this

//for physics based
var moveSpeed : float = 10;

function Update ()
{
var move : float = Input.GetAxis ("Horizontal") * moveSpeed * Time.deltaTime;

transform.Translate  (move,0,0);
}

//for wheel colliders
var frontWheels : WheelCollider [];
var maxSteer = 25;

function Update  ()
{
for (var wheel : WheelCollider in frontWheels)
{
var steer = Input.GetAxis ("Horizontal") * maxSteer;
wheel.steerAngle = steer;
}
}

Again I don’t know if this will help, but I hope it does