Enemy wont die[sovled]

So i have health bar everything set up no errors occur but the enemy Ai i have set up once he hits zero dosn’t play his death animation, from the code i used it should so im unsure whats problem is. code below is what detects the hits, his health bar does go down so i know i am hitting him correctly just health.

sing System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class DetectHit : MonoBehaviour {
    public Slider heatlhbar;
    Animator anim;
    private void OnTriggerEnter(Collider other)
    {
        heatlhbar.value -= 30;
    }
    // Use this for initialization
    void Start () {
        anim = GetComponent<Animator>();
        if (heatlhbar.value <= 0)
        {
            anim.SetBool("isDead", true);
        }
    }
   
    // Update is called once per frame
    void Update () {
       
    }
}

Your line that checks health is only being run in Start(), so it’s only checking whether he’s dead on the first frame of the game. Move that to Update().

That work thanks but i am also idiot cause re-watching what I trying duplicate i had in wrong location begin with.