how get my character runs in 3 lines, LEFT | MIDDLE | RIGHT

In my code my character moving left right its and the course if 3 lines but my character can move outside map i will the character can move one time left and back to middle of the map and right and back to middle. Not 2 times left because if you move 2 times left or right the character is outside map.
almost like subway surfer and othergame.

Hope you understand my bad english

My code

moveVector = Vector3.zero;

if (controller.isGrounded)
{
verticalVelocity = -0.5f;
}

else
{
// verticalVelocity -= gravity * Time.deltaTime;

}

// X - Left and Right
moveVector.x = Input.GetAxisRaw(“Horizontal”) * speed;

// Y - Up and Down
moveVector.y = verticalVelocity;

// Z - Forward and backward
moveVector.z = speed;

controller.Move (moveVector * Time.deltaTime);

}

public void SetSpeed(float modifier)
{
speed = 30.0f + modifier;

}
// it is beign called every time our capsule hits something
private void OnControllerColliderHit(ControllerColliderHit hit)
{

if (hit.point.z > transform.position.z + controller.radius)
Death ();
}

private void Death()
{
isDead = true;
GetComponent ().OnDeath ();

First, use code tags Using code tags properly - Unity Engine - Unity Discussions
Else this is hard to read.

Now, if you have three lanes and your char “snaps” to those lanes. (example if I’m in the middle lane and I hit left, it moves me to the left lane, which is a set spot), then you just need to keep track of what lane they are in. So if I’m in the left lane I can’t move left again.

If my character can move over and keep moving, you will have to add a clamp to the movement or set up a collider (I prefer clamping, but it depends on your use case). If you use clamping, you can clamp your moveVector.x and keep from going above or below a certain number, keeping them within a certain x range.