Hello…
I am trying to make a runner game with lanes…
I have the movement on Z axis and Lerping on X axis
but the lerp is not smooth…it gets stuck at half point on the X axis
is it coz of the movement ?
here is my code on the update function
if(Input.GetKeyDown(KeyCode.Q))
transform.position = Vector3.Lerp(transform.position, new Vector3(-3.75f, transform.position.y, transform.position.z), 100 * Time.deltaTime);
if(Input.GetKeyDown(KeyCode.W))
transform.position = Vector3.Lerp(transform.position, new Vector3(-1.25f, transform.position.y, transform.position.z), 100 * Time.deltaTime);
if(Input.GetKeyDown(KeyCode.E))
transform.position = Vector3.Lerp(transform.position, new Vector3(1.25f, transform.position.y, transform.position.z), 100 * Time.deltaTime);
if(Input.GetKeyDown(KeyCode.R))
transform.position = Vector3.Lerp(transform.position, new Vector3(3.75f, transform.position.y, transform.position.z), 100 * Time.deltaTime);