Run to Walk Issue

Hi everyone,

I want my character (who uses Mecanim) to be able to walk if ‘4’ isn’t being pressed, and to run if ‘4’ is being pressed. So I’ve written some almost perfect code (Mek refers to the AnimatorController):

if (Input.GetKeyDown("4"))
	{
		Mek.SetBool("Running",true);
	}else if (Input.GetKeyUp("4"))
	{
		Mek.SetBool("Running",false);	
	}

I have it working correctly, but the only thing is the guy keeps running even if I’ve released the movement key and am still pressing ‘4’ (movement is independent and works great with or without the previous code up above):

	var v:float=Input.GetAxis("Vertical");
	Mek.SetFloat("Speed",v);	//walking anim. dependant on button

I know the problem: the code says as long as you’re pressing 4, running is true. I just don’t know how to fix it. I’ve tried many things, but without success.
Any help would be appreciated.

Well, the answers are in the comments. Nobody wanted to copy and paste, so I am doing it myself…