"Not running script because past shutdown deadline" Freezes Studio

When the
‘Not running script because past shutdown deadline’
error is thrown it completely freezes my Studio playtest.
At that point I have to force the application to quit.

Expected behavior

It should throw the error and end the playtest.
Would be great if it gave me a call stack for where the yield happens.

you can see in the bottom right the scheduler isnt doing anything and studio seems unresponsive

Until you fix the script causing this, you can change “Script Timeout Length” under Studio Settings to -1.

i use a bindtoclose module to call all closing functions after the prior has finished

-- Handle all closing functions in a single asynchronous loop on game closure
local closeFunctions = {} :: { () -> nil }

local function CallClosing()
	for _, callback in closeFunctions do
		callback()
		task.wait()
	end
end

game:BindToClose(CallClosing)
-- Add the given function to the close loop, calling it when the game closes. The experience will remain open for 30 seconds before forcefully closing.
return function(callback: () -> nil)
	table.insert(closeFunctions, callback)
end

adding in a task.wait() fixed my issue.
assuming its something related to “script exhaustion timeout” similarly found when endlessly looping

1 Like