I remember seeing it in one of Friaza's tutorials, but I'm not quite sure what it does. I know that you can use RenderStepped to do something every 60th of a second, and you can use wait to pause the script for a 30th of a second. What does combining them do?
RenderStepped
is an event of RunService
. It's fired every frame render which is aproximately 1/60th of a second.
wait
is a function that can wait down to aproximately 1/30th of a second.
When you use game:GetService('RunService').Renderstepped:wait()
it makes RenderStepped redundant since the fastest the wait function can wait is apox 1/30th of a second. Just remove the wait() and have it in an event!.
game:GetService('RunService').RenderStepped:connect(function() --code end)
The above code would run every RenderStep, aprox 1/60th of a second.
I don't really know what you mean by combining them, but RenderStepped
can only be used in local scripts
and it's basically a wait(1/60)
, but without RenderStepped
the least you can go to is wait(1/30)
, you should only use RenderStepped
if you want to make something run as smooth as possible. For example moving a Textlabel locally.
Note: If you only write wait() without any number in the parameters that already defaults to wait(1/30)
local rs = game:GetService("RunService").RenderStepped for i = 1, 20 do rs:wait() local text = script.Parent text.Position = text.Position + UDim2.new(0,1,0,0) end
That would make the gui move really smoothly as nearly as if it was tweening, if not already.
Hope this helps!