(C#) problems with character script

Hi, I’ve been working on a script for my character and I’ve run into a few bugs that have me completely stumped. I’ve been having trouble with the jumping and the effects of the character being hit by an enemy.

whenever the character jumps he just teleports to the hight of his jump and then falls, I’ve been trying to make it more smooth but I can’t seem to get it to work and it’s odd because I’ve used the same method before in another game I made and it worked perfectly now I have to set the value of the jump insanely high just for the character to get off the ground and I also have to make the gravity insanely high for him to fall at a realistic rate. although this might have something to do with the size of the character… I’m not quite sure.

I’m also trying to make the character flash for a few seconds whenever he is hit by an enemy, but the yeild command dose not seem to work, and he sometimes takes double the damage even though I turn off damage when he first gets hit.

I might just be missing a few very obvios things but it would really help if I could get someone else to take a look at it and point out any errors I’ve made.

Here is the currant version of the code:

using UnityEngine;
using System.Collections;

public class CharacterMovement : MonoBehaviour {

	public float speed = 20F;
	public float gravity = 500F;
	public float jump = 10F;
	public float Health = 4F;
	bool ishit = false;
	public Transform Health_GUI;
	public Transform cube;
	public Texture2D[] Health_Texture;
	Vector3 moveDirection = Vector3.zero;
	
	void OnGUI () {
		Health_GUI.guiTexture.texture = Health_Texture[(int)Health];
	}
	
	void Update () {
		CharacterController controller = GetComponent<CharacterController>();
		moveDirection = new Vector3(Input.GetAxis("Horizontal"), 0, Input.GetAxis ("Vertical"));
		moveDirection = transform.TransformDirection(moveDirection);
		moveDirection *= speed;
		if (controller.isGrounded){
			if (Input.GetButton("Jump"))
				moveDirection.y = Mathf.Sqrt(2 * jump * gravity);
		}
		
		moveDirection.y -= gravity * Time.deltaTime;
		controller.Move(moveDirection * Time.deltaTime);
	}
	
	void OnControllerColliderHit (ControllerColliderHit hit){
		if (hit.collider.gameObject.tag == "enemy"){
			if (ishit == false){
				Health -= 1;
				ishit = true;
				CharacterMovement script = gameObject.GetComponent<CharacterMovement>();
				script.hit();
			}
		}
	}
	
	void	hit (){
		cube.renderer.enabled = false;
		float flash = 5F;
		
		while (flash > 0){
			cube.renderer.enabled = false;
			yield return new WaitForSeconds(.5);
			cube.renderer.enabled = true;
			flash -= 1;
		}
	}
}

use a jumpspeed