public void playerSpawn(GameObject newGameObject) { // attach camera CameraCtrl cameraCtrl = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <CameraCtrl>(); cameraCtrl.Attach(newGameObject); // wait before spawning the character StartCoroutine(EndSpawn(newGameObject, endOfSpawnDelay)); }