private IEnumerator Respawn() { transform.position = new Vector3(0, 0, 0); yield return(new WaitForSeconds(10)); GuiManager.HideDeathScreen(); GuiManager.HideScoreBoard(); Cursor.lockState = CursorLockMode.Locked; Cursor.visible = false; gameObject.GetComponent <Renderer>().enabled = true; transform.rotation = Quaternion.identity; GetComponent <WeaponManager>().ReinstantiateWeapons(); transform.position = GameObject.Find("GameManager").GetComponent <GameManager>().GetRandomSpawnpoint().position; state.Health = 100; state.IsDead = false; }