private void OnTriggerEnter(Collider other) { if (other.gameObject.tag == "Checkpoint") { PlayerCheckpointTrigger = true; } if (other.gameObject.tag == "ExtraLifeCoin") { HealthManager healthManager = GetComponent <HealthManager>(); healthManager.AddExtraLife(); } if (other.gameObject.tag == "LevelUpCoin") { hexaCounter++; LevelUpText.text = "Goal: " + hexaCounter + "/5"; if (hexaCounter == hexaGoal) { hexaGoalTrue = true; ballMesh.GetComponent <MeshRenderer>().material = ballPurpleMaterial; ballDefaultMaterial = ballPurpleMaterial; } if (hexaCounter > hexaGoal) { hexaCounter = hexaGoal; LevelUpText.text = "Goal: " + hexaCounter + "/5"; } } if (other.gameObject.tag == "BlackHole") { playerBlackHoleTrigger = true; } }