public void startGame() { lobbyScript lScript = lobby.GetComponent <lobbyScript> (); lScript.hideLobby(); game = MonoBehaviour.Instantiate(gamePrefab) as GameObject; gameManager = game.GetComponentInChildren <GameManager> (); gameManager.NumPlayers = lScript.getNumOfPlayers(); gameManager.lobby = lScript; gameRunning = true; }