Huh, Debug.Log just does not work with coroutines?!

SOLVED thanks to Eric5h5

The gotchya is simply that the “Collapse” button in Console was turned on. If a string being printed repeats, it only prints the first one!

(If for some reason you need Collapse turned on, ensure that the log statement inside your loop changes each time by adding a counter or random number!)


I’ve only just noticed this …

function Start()
	{
	while(1)
		{
		teste();
		yield WaitForSeconds(.5);
		}
	}
var TESTER:int;
function teste()
	{
	++TESTER;
	Debug.Log("yo!");
	}
-- or, same result --
-- or, same result --
function Start()
	{
	InvokeRepeating("teste",.5,.5);
	}

Quite simply, you won’t see any output from the Debug.Log statement. It might print once or twice only, but that’s it.

Turn off “collapse” in the console. Debug.Log works fine in coroutines.