This is a piece of my script. The health value equals what I tell it to, but each time it calculates it as if the Health value doesn’t change at all. Anything look weird in this:
if(other.collider.GetComponent(HealthSystem)) {
HealthS = other.collider.GetComponent(HealthSystem);
Health = HealthS.Central.GetComponent(CentralHealth).Health;
if(HealthS.IsHead == true) {
Debug.Log("Hit something!");
Health = Health - Damage;
}
if(HealthS.IsTorso == true) {
Debug.Log("Hit something!");
Health = Health - Damage / 2;
}