I am creating a 3D endless runner that's a little different than the norm. There are 5 Lanes that are 1 unit wide, and the player can fall off the sides if they move too far to the left or right. The Player does not move Forward, Jump or Slide. It only has left or right movement. The player can get bounced backward if hit by an oncoming obstacle that increases in speed over time.

In regards to the player's left/right movement, I got it pretty close. But I'm having trouble getting precise positioning of the player.

Sometimes when the player moves over a lane the position will sometimes be off by 0.1, and may start to stack up over time. i.e. Starting in the 0 position, move left, it stops at 0.9 or 1.1.

This is the code so far -

```
{
public float speed;
public float mleft = -0.7f;
public float mright = 0.7f;

private Rigidbody rb;

// Start is called before the first frame update
void Start()
{
    rb = GetComponent<Rigidbody>();
}

// Update is called once per frame
void FixedUpdate()
{
    if (Input.GetKeyDown("a"))
    {
        rb.velocity = new Vector3(mleft, 0, 0) * speed;
        StartCoroutine(stopLaneCH());
    }

    Debug.Log(GetComponent<Transform>().position);

    if (Input.GetKeyDown("d"))
    {
        rb.velocity = new Vector3(mright, 0, 0) * speed;
        StartCoroutine(stopLaneCH());
    }

}

IEnumerator stopLaneCH ()
{
    yield return new WaitForSeconds(0.5f);
    GetComponent<Rigidbody>().velocity = new Vector3(0, 0, 0);
}

```

}

I've had to try and find a balance between the *speed* and the *mleft/mright* variables that would move the player 1 unit.

I am still fairly new to Unity and programming, but any help with this problem is greatly appreciated.

*And I may even name my 3rd child after anyone that helps solve this problem.*