Animation scripting problem.

Ok, Now I’m smart and I’m using a boolean. Pressing W changes the value in the animator window to true and triggers a walk animation. But releasing W, does nothing, the boolean stays true.

using UnityEngine;
using System.Collections;

public class Movement : MonoBehaviour {
    public float speed = 6.0F;
	public float rotationSpeed= 12.0F;
    public float jumpSpeed = 8.0F;
    public float gravity = 20.0F;
	public 	Animator anim;
    private Vector3 moveDirection = Vector3.zero;
    void Update() {
        CharacterController controller = GetComponent<CharacterController>();
        if (controller.isGrounded) {
            moveDirection = new Vector3(0, 0, Input.GetAxis("Vertical"));
            moveDirection = transform.TransformDirection(moveDirection);
            moveDirection *= speed;
            if (Input.GetButton("Jump"))
                moveDirection.y = jumpSpeed;
			if (Input.GetKey (KeyCode.A)) 	
				transform.Rotate(Vector3.up * Time.deltaTime * -rotationSpeed);
			if (Input.GetKey (KeyCode.D)) 	
				transform.Rotate(Vector3.up * Time.deltaTime * rotationSpeed);
			if (Input.GetKey (KeyCode.W))
				anim.SetBool ("walk", true);
            
        }
        moveDirection.y -= gravity * Time.deltaTime;
        controller.Move(moveDirection * Time.deltaTime);
    }
}

First thing I saw was that you didn’t set the bool false anywhere in your code, so you can’t expect it to change by itself (can you)? So try doing this:

Where you have

if (Input.GetKey (KeyCode.W))
                 anim.SetBool ("walk", true);

add below

if (!Input.GetKey (KeyCode.W))
                 anim.SetBool ("walk", false);

Putting an exclamation mark (!) before the Input.GetKey you check if you let go of the KeyCode.

! ← Works as a false, basically. For example:
You can either type

if(exampleBoolean == false) 

or

if(!exampleBoolean)

It will do the same.