IEnumerator Record() { while (isRecording) { recording.AddRecord(new Record(transform.position, transform.rotation, (health != null ? health.health : -1f))); yield return(new WaitForSeconds(recordDelay)); } }