RenderStepped doesn't fire when minimized or script tab open

RendersStepped/BindToRenderStep don’t fire when my Studio window is minimized or I have a script tab open in the same tab window as the viewport. However the Stepped and Heartbeat events do fire in both scenarios.

The following code demonstrates this:

game:GetService'RunService':BindToRenderStep('',Enum.RenderPriority.Last.Value+1,function()
--game:GetService'RunService'.RenderStepped:Connect(function()
	warn'r'
end)
game:GetService'RunService'.Stepped:Connect(function()
	print's'
end)
game:GetService'RunService'.Heartbeat:Connect(function()
	print'h'
end)

You’ll see a period where ‘r’ stops being outputted in orange if you scroll up a bit in the output window after having minimized studio, or you can see this happen live if you just open a script tab. I’m on Windows 10 Pro OS Build 19042.804

2 Likes

For RenderStepped not firing when Studio is minimized, I believe this is intended. When the game window is minimized, there is no need to render frames, so RenderStepped does not get called during this time. I’m not really sure about RenderStepped stopping when a script tab is open though, this might be your CPU stopping the render to save resources, but on my machine, when I open a new script tab, RenderStepped still runs.

5 Likes

Not a bug, it’s in the name: Render Step. When Studio is minimized it isn’t rendering, so naturally something bound to happen pre-render doesn’t happen. The engine pretending that a fake render cycle is going on anyways would be very surprising behavior.

You have to take your pick: Either you have game logic, and that game logic should not be exactly tied to the render frequency to begin with, or you have rendering logic that should be tied to the render step, and thus doesn’t need to run when no rendering is happening.

TL;DR: Binding important game logic to the render step isn’t a good idea. For instance, consider what happens if someone plays your game with FPS unlocker at 240Hz.

7 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.