Hi!
I start to create run script to my character (FPS) but i’m can’t start it with left shift:
var run = false;
var timer : float = 0.0;
if (Input.GetKey(KeyCode.LeftShift)) //at here
{
speed = 20;
run = true;
}
if(run)
{
timer += Time.deltaTime;
}
if(timer >= 5)
{
run = false;
speed = 15;
timer = 0;
}
Please help me!