public void EndGame() { replayPrompt.gameObject.SetActive(true); var finalScoreText = GameObject.Find("FinalScore"); if (!finalScoreText) { Debug.LogError("Could not find Final Score Text"); } finalScoreText.GetComponent <Text>().text = scoreDisplay.GetFinalScore(); }