Disable and Enable UI text in function

so far this is my using code. what i want is. if i kill a zombie the word “zombie kill +5pts” will show up and disappear after 1 second. and appear again when i kill another zombie. like in Call Of Duty Multiplayer. any help and suggestion is accepted thanks. by the way this script is attached on zombie

Text KillZmbText;

	void Start () {

		anim = GetComponent<Animator> ();

		KillZmbText = GameObject.Find ("Zombie Hit!! + 5pts").GetComponent<Text> ();

	void StopShowingZombieText(){
		KillZmbText.enabled = false;

	public void AppliedDamage(float damage){

		health -= damage;

		if (health <= 0f) {


			Destroy (gameObject,2);

			KillZmbText.enabled = true;
			Invoke ("StopShowingZombieText", 1);



it’s very simple and easy idea :).
you need a UI text

public void Zombie Hit(){



public IEnumerator aa(){
	t1.text="Zombie Hit!! + 5pts";
	yield return new WaitForSeconds (1);
	t1.text = "";


hope you get it :).

download this ,it might help


and then click on it to download ,it’s not an English site and try not to sacre :smiley: .