playing animation on button press

can anyone tell me how i would make my character move forward whilst it plays the walk animation that ive created when i press the w,a,s,d keys?

maybe try this:

if(Input.GetKey("w")){
transform.Translate(transform.forward * Time.deltaTime);
animation.Play("walk");
}
//and there you continue