IEnumerator ShutOff() { lightSwitch.Safe(true); floorSound.PlayOneShot(powerDown); floor.SetActive(false); animator.SetBool("up", false); Debug.Log("Waiting " + time * distance + " seconds..."); yield return(new WaitForSeconds(time * distance)); animator.SetBool("up", true); floorSound.PlayOneShot(powerUp); floor.SetActive(true); lightSwitch.Safe(false); }