public void Start() { Dumpster = FindObjectOfType <Dump>().gameObject; Time.timeScale = 1f; gm = FindObjectOfType <WaveSpawner>(); Restartgame = false; maxUnits = 0; googleAnalytics.GetComponent <GoogleAnalyticsV4>().LogEvent("LocationViewing", "TheMainMenu", "Viewing", 1); Player[] playerUnits = GameObject.FindObjectsOfType <Player>(); foreach (Player p in playerUnits) { CurrentUnits = CurrentUnits + 1; } }