How to move player horizontally on only one object or one lane?

I just want to move a player on the strip. I want to move a player horizontally on horizontal lane and vertically on vertical lane in 2D game. How to do this?

With the player’s transform. A script attached to the player game object can access it’s transform as follows:

transform.position.x += 2;

or

transform.position.y -= 1;

If you’re using C#, you’ll need to set up a new Vector3:

Vector3 pos = transform.position;
pos.x += 2;
transform.position = pos;

But the example at the top should be fine for Unityscript.