Cancel a timer inside of itself (SOLVED)


	local text_delay = timer.delay(0.05, true, function()
			timer.cancel()
	end)

I thought doing this might work but it wants a specific handle. The docs seem to support this is the intended way to do it. Am I doing something wrong?

Solution: Timer.delay() returns nil handle (SOLVED)

Yes, the callback signature is:

function(self, handle, time_elapsed)

You should use handle as argument to timer.cancel(handle).

2 Likes