When the player presses a direction (WASD) twice, I want it so the player basically side steps or a small jump to the side or forward might be a better way to describe it.
if(Input.GetKeyDown(KeyCode.A)) {
if(!one_press)
{
one_press = true;
delay = Time.time + .2;
timer_for_double_press = Time.time;
}
else
{
one_press = false;
transform.Translate(Vector3 * 20 * Time.deltaTime);
}
}
if(one_press)
{
if((Time.time - .2) > delay)
{
one_press = false;
}
}
this is my double press check script, it works fine but transform.Translate(Vector3 * 20 * Time.deltaTime); sets the player a distance from his current position without a smooth transition.
Is there way to move the player in a direction over the course of say half a second?
Thanks!