public void ActivateRandom() { // add to applied mods int i = Random.Range(0, modIndex.Count); Mod chosen = modIndex[i]; appliedMods.Add(chosen); chosen.Activate(); appliedModNames.Add(chosen.GetName()); // do splash GameObject player = GameObject.FindGameObjectWithTag("Player"); //GameObject canvas = player.GetComponentInChildren<Canvas>(); Text textComponent = player.GetComponentInChildren <Text>(); textComponent.text = chosen.GetName(); showText(textComponent); StartCoroutine(fadeText(textComponent)); }