private void OnTriggerEnter(Collider other) { if (other.gameObject.tag == "Coin") { Destroy(other.gameObject); coinsCount += 1; coinsCounter.text = coinsCount.ToString(); } if (other.gameObject.tag == "obstacle") { rg.PauseLevel(); coinsCounter.text = "You Die"; } }