void OnTriggerStay(Collider box) { if (box.name == "GoalBox" && spawner.CanWin() && notWon) { // win! PlayerPrefs.SetInt("Score", PlayerPrefs.GetInt("Score") + 1000); StartCoroutine(winner); notWon = false; canMove = false; GetComponent <PlayerMoveset>().PreventAttack(); } }