Timer.delay Not Working In Headless Mode? (SOLVED)

Is timer not supposed to work in headless mode, or is it a possible bug? The same timer code works fine running on normal build (windows), but if I bundle for windows headless, the timer function no longer works.

function call_every_second(self, handle, time_elapsed)
	counter = counter + 1
	print("Call #", counter)
	if counter == 10 then
		timer.cancel(handle) -- cancel timer after 10 calls
	end
end

function init(self)
	timer.delay(1, true, call_every_second)
end

Do I have to do something different in headless?

Scratch that, I had a UDP sever blocking the thread, so nothing else could trigger. Timer working fine in headless mode :rofl:

1 Like