Hello everybody. I wrote this script which is supposed to make healthScript.SlimeDamage(); run every so often but it only executes once . What did I do wrong?
void attackTimer(){
slimeBasicAttack = true;
}
void Update () {
InvokeRepeating ("attackTimer", 100, 1000f);
GameObject health = GameObject.Find ("Hero");
//"Hero" can be replaced by name of GameObject that the the Health script is on
Health healthScript = (Health)health.GetComponent (typeof(Health));
if (slimeBasicAttack == true && dodge == false) {
healthScript.SlimeDamage ();
slimeBasicAttack = false;
}
}
}