private void OnTriggerEnter(Collider other) { if ((other.name.Contains("Wall") || other.name.Contains("Top") || other.name.Contains("Bottom")) && !miss && !needsReset) { miss = true; needsReset = true; Debug.Log("Miss!"); game_manager.playFail(); } if (other.name.Contains("Sphere") && !miss && !needsReset) { if (other.name.Contains("Point")) { Destroy(other.gameObject); } else if (other.name.Contains("Target")) { Destroy(other.gameObject.transform.parent.gameObject); } needsReset = true; Debug.Log(other.name); game_manager.playSuccess(); } }