public void OnButtonPlayAgainClick() { score.GetComponentInChildren <Text>().text = "0"; Tube.DeleteAll(); character.SetDefaultValues(true); character.rigidbody2D.constraints = RigidbodyConstraints2D.FreezeAll; character.gameObject.transform.position = Vector3.zero; character.rigidbody2D.velocity = Vector3.zero; character.gameObject.transform.rotation = Quaternion.identity; character.rigidbody2D.constraints = RigidbodyConstraints2D.None; deadMenu.SetActive(false); score.SetActive(true); // remove button focus EventSystem.current.SetSelectedGameObject(null); }