I want this script to destroy the enemy

using UnityEngine;
using System.Collections;

public class death : MonoBehaviour {
	Transform curTransform;
	void Start(){
		curTransform = gameObject.GetComponent<Transform>();
		curTransform = gameObject.transform;
	void Update(){
		EnemyHealth eh = gameObject.GetComponent<EnemyHealth>();
		eh.health = 0;
		GameObject Wolf_run;

	void Updatetwo(){

the script does not do anything when the enemy reaches 0 health I want the enemy to be destroyed when it reaches zero health. im very new to coding

okay if your new I see no harm in telling you what your doing wrong.

  1. you getting a component of a component, after you assign Enemy health just use eh.health, no need for this line


  2. you set the enemy health every frame(Update runs every frame) this should really be

    if(eh.health == 0)

  3. UpdateTwo(its not like update, you have to call it manually) never gets called, i would call it right after

    if(eh.health == 0)

  4. You double assign CurTransform delete this line

    curTransform = gameObject.GetComponent();

you also declare a useless variable called “wolfRun”
Scrap it.

that should just about cover it…hope it helps.
also check some C# tutorials by