Repeat yield

Hello,

why code bellow doesn’t repeat yield?

Yield is being called once and after that, 1 and 2 starts to change chaotically :frowning:

function SavePaused(){
	print("1");
	
	yield WaitForSeconds(10);
	
	print("2");
}

function Update () {
	StartCoroutine(SavePaused());
}

Update runs every frame without exception, so you are starting your SavePaused coroutine every frame, which means you soon have thousands of SavedPaused routines running at once. Also, in JS you don’t need to write out “StartCoroutine”, that’s used automatically.

–Eric