[Solved] how to create endless yield C#

Hi guys,

In JS i was able to create a yield that would repeat itself for ever but how do i do it in C#?

this is my JS code:

while (true) {
yield WaitForSeconds (1); 
print("hello");
}

Figured it out,

It’s exactly as written, i don’t know why it didnt work before, thanks for reading :slight_smile:

The actual C# code looks like this.

IEnumerator MyCoroutine (){
    while (true){
        yield return new WaitForSeconds(1f);
    }
}