When I kill one of the two enemies, both dies

I have two of the same enemies, that has the same amount of health and they have the same scripts attached because they are both skeletons
But when I kill one, both dies.
How can I fix it, because I dont want to make a new scripted for each enemy if they are the same.

Have you tried duplicating the script for each skeleton and attaching a separate copy? Do you still get the same results?

Have you made sure that the health pool for the “skeletons” is not static?

Hopefully this helps! Best of luck.

Don’t use static variables unless you really need to or know what they do. Static variables belong to the class, not the objects, so there is only ever one single instance of a static variable. Static is not a keyword for easy access.

If you make a enemy class, each class variable is independent of another.

 class Enemy ( MonoBehavior ):
       public health as single  = 30.0F
    
       def hit ():
          health -= 10.0
     
    //In another script just create a new instance of the class
    //soo...
    
    mob1 = Enemy ()
    mob2 = Enemy ()
    
    //or make an array.. for boo it is..
    mobs as (Enemy)
    
    //then do the hit and damage is applied to each unique //instance of the class Enemy