void Damage() { //On damage do particle effects and play sound do animation BarController barcontroller = GameObject.Find("Captain").GetComponent <BarController>(); if (barcontroller.GetPick() == true) { damage = 2; } health -= damage; damage = 1; shakeAnim.DOPlayById("SHAKE"); audioS.PlayOneShot(damage_sound, 1f); Instantiate(particleBits, this.gameObject.transform.position, Quaternion.Euler(270, 45, 0)); }