void OnTriggerEnter(Collider other) { if (other.gameObject.tag == "Player") { //PlayerHealth = other.gameObject.GetComponentsInChildren<playerHealth> (); // other.GetComponentInChildren<playerHealth>().AddHealth(10); playerHealth.AddHealth(10); Destroy(gameObject); } }