void LowerHealth() { HP--; if (HP < 1) { //Destroy(Sprite, 0); BgController.RemoveColor(this.tag); //HealthBar.SetActive(false); rend.enabled = false; if (BgController.GetColor() == this.tag) { BgController.SwitchColor(); } Debug.Log("OBJ " + Obj); //Obj.SetActive(false); //rendererSetActive(!gameObject.activeSelf); } else { //temp = HealthBar.transform.localScale; //temp.x = temp.x * HP / MaxHP; //float tempF = temp = new Vector2((float)HP / MaxHP, HealthBar.transform.localScale.y); temp.x = HbScale * HP / MaxHP; //temp. Debug.Log("HP " + HP + " MaxHP " + MaxHP + " HealthBar " + temp.x + " FLOAT " + temp); //tempF; HealthBar.transform.localScale = temp; Debug.Log("LOCAL Scale " + HealthBar.transform.localScale); //HealthBar.transform. } }