Quantcast
Channel: Questions in topic: "error"
Viewing all articles
Browse latest Browse all 7934

"Health" value doesn't change?

$
0
0
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; }

Viewing all articles
Browse latest Browse all 7934

Trending Articles