Renderstepped Until (Example)

Is there a way to use RenderStepped until a certain value is true/false, or is there a way to stop a RenderStepped “loop”?

try putting the render stepped into a variable (just like how youd do it with an event), then disconnecting the variable once u want it to end

1 Like

A way to do this is by disconnecting the RenderStepped event:

local connection
connection = game:GetService("RunService").RenderStepped:Connect(function()
	--Do stuffs
end)

--When you want to stop the loop:
connection:Disconnect()

Though, you may also want to check out RunService:BindToRenderStep, which is basically .RenderStepped but in a function form. You can stop a loop made by this by using RunService:UnbindFromRenderStep.