# My character is not switching right or left like subway surfer in 2D?

I am making a 2D subway surfer type of game right now and I found this code on the internet that switches the lane of the player but the problem is it doesn't switch. When I play the scene it won't move it will just give the of "int" desiredLane. Why is this happening?

CODE

private const float LANE_DISTANCE = 3.0f;

public float moveSpeed;

public int desiredLane = 1; //0 = Left 1 = Middle 2 = Right


void MobileSwipeControl()
{
//Movement Input
if (Input.GetKeyDown(KeyCode.A))
MoveLane(false);
if (Input.GetKeyDown(KeyCode.D))
MoveLane(true);

//Calculate where we should be in the future
Vector3 targetPosition = transform.position.y * Vector3.up;

if (desiredLane == 0)
targetPosition += Vector3.left * LANE_DISTANCE;
else if (desiredLane == 2)
targetPosition += Vector3.right * LANE_DISTANCE;

//Let's calculate our move delta
Vector3 moveVector = Vector3.zero;
moveVector.x = (targetPosition - transform.position).normalized.x * moveSpeed;
moveVector.y = moveSpeed;

//Move the player
myBody.velocity = Vector2.up * moveSpeed;
}


private void MoveLane(bool goingRight)
{
desiredLane += (goingRight) ? 1 : -1;
desiredLane = Mathf.Clamp(desiredLane, 0, 2);
}


//Move the player