/** * Teleports player to new location. * * @param targetlocation Vector3 of new location * @param entryStage name of new map */ public void TeleportToLocation(Vector3 targetLocation, string entryStage) { this.transform.position = targetLocation; CameraFollow CFollow = GameObject.Find("Main Camera").GetComponent <CameraFollow>(); CFollow.ChangeBounds(GameObject.Find(entryStage).GetComponent <BoxCollider2D>()); }