character is moving forward on its own

hi everyone, I’m quite new to Unity. So I hope someone can help me. I’m writing a movement script. Moving and jumping is okay but the character will move forward itself.
Here’s my script:
public class NewMovement : MonoBehaviour {

public float speed = 6F;
public float sprintSpeed = 10F;
public float jumpSpeed = 8F;
public float gravity = 20F;
private Vector3 moveDirection = Vector3.zero;
CharacterController cc;
Animator anim;

// Use this for initialization
void Start () {
	cc = GetComponent<CharacterController> ();
	anim = GetComponent<Animator> ();


}

// Update is called once per frame
void Update () {
	 
	if (cc.isGrounded) 
	{
		moveDirection = new Vector3 (Input.GetAxis ("Horizontal"), 0, Input.GetAxis ("Vertical"));
		moveDirection = transform.TransformDirection (moveDirection);
		moveDirection *= speed;
		if (Input.GetButton("Jump"))
		{
		    moveDirection.y = jumpSpeed;
		}
		if (Input.GetKey(KeyCode.LeftShift))
		{
			moveDirection *= sprintSpeed;
		}
		Debug.Log("grounded");
	}
	moveDirection.y -= gravity * Time.deltaTime;
	cc.Move (moveDirection * Time.deltaTime);
	anim.SetFloat ("Speed", moveDirection.magnitude);

}
void FixedUpdate () {

}

}
I really dun know what the problem is. So plz help!

cc.Move() is in update, which means that it will be called every frame. This will cause it to move continually. If you want to limit movement by key press, put it in an if statement.

See: