Simple run script

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!

Your not having your character go anywhere, you need to use GetAxis(“Horizontal”) or GetAxis(“Vertical”) Check the built in character controllers for more of a reference

So what exactly doesn’t work? Is the input itself not registering or is something not setting?
Replace your code with a debug.log and see if it logs. Also where is this put in? It needs to go in update or fixed update.