public IEnumerator RipApart() { scraps.transform.position = transform.position; ParticleSystem pSystem = scraps.GetComponent <ParticleSystem>(); pSystem.Play(); yield return(new WaitForSeconds(pSystem.main.duration)); InitPlayer(); obstacleSpawner.InitObstacles(); gameObject.GetComponent <BoxCollider>().enabled = true; updateDistanceFallen = true; foreach (Transform wall in walls) { wall.gameObject.GetComponent <Wall>().SetScroll(true); } obstacleSpawner.SetRise(true); }