I need help with my java i have used this script to destroy the enemy when health is = to or under 0
#pragma strict
var Health = 100;
function Update ()
{
if(Health >= 0);
{
Destroy(gameObject);
}
}
function ApplyDammage (TheDammage : int)
{
Health -= TheDammage;
}
the destroy game object is running instantly and killing of the enemy before the health has bean reduced basically. dose anyone know how to solve it if so you can either email me at onefishykid2015@gmail.com or post back on these forums it will be greatly appreciated thank you.
there is another script By the way that inflicts the damage and it dose reduce health from 100 to 50 to 0. i tested without the destroy game object in and it worked