Im making a script for movement that is based off of the old nintendo style jrpgs. The script is supposed to move my player to the destination position in a Vector3.Lerp. When i try to move my character moves only a few feet and jitters back and forth at really small distances. What am i doing wrong?
private void InputMovement(){
transform.position = Vector3.Lerp(startPosition, endPosition, 1 * Time.deltaTime);
if (Input.GetKey (KeyCode.W)){
endPosition = startPosition + new Vector3(0,0,1);
}
if (Input.GetKey(KeyCode.S)){
endPosition = startPosition + new Vector3(0,0,-1);
}
if (Input.GetKey(KeyCode.D)){
endPosition = startPosition + new Vector3(1,0,0);
}
if (Input.GetKey(KeyCode.A)){
endPosition = startPosition + new Vector3(-1,0,0);
}
}