simple character movement

for the past week iv been looking for a script that simply when your press w if plays your forward walking animation, s backward walking animation and so on.

i basicly want something i can understand as im new to scripting, iv used lots of premade more complicated scripts and cant figure out how they work so this would help me undertsand whats happening >.<

i found this and its pretty much what i want:

if (Input.GetKey("w"))
	{
Debug.Log("Moving Forward");
		rigidbody.AddForce( (transform.forward * Time.deltaTime * 3) ,ForceMode.Acceleration);


        if (!gameObject.animation.isPlaying)
        {
            gameObject.animation.Play("YourAnimationNameHere");
        }

	}

but would someone be able to help me add blending to this? still keeping it relatively simple

any help would be greatly appreciated

Use .CrossFade instead of .Play.

aah thanks