Stepped (Event): Difference between revisions

From Legacy Roblox Wiki
Jump to navigationJump to search
>Legend26
No edit summary
m Text replacement - "</SyntaxHighlight>" to "</syntaxhighlight>"
 
(10 intermediate revisions by 4 users not shown)
Line 1: Line 1:
<onlyinclude>{{Event|name = Stepped
<onlyinclude>{{Event|name = Stepped
|arguments = [[Number]] ''time'', [[Number]] ''step''
|arguments = [[number]] <var>time</var>, [[number]] <var>step</var>
|description = Fired on every 'step' in the RunService, a time of approximately 1/30th of a second.
|description = Fired on every "step" in the RunService, a time of approximately 1/30th of a second. The <var>time</var> argument is how long the RunService has been running overall. The <var>step</var> argument seems to always be 1/30, which is an approximation of one frame.
|object = RunService
|object = RunService
|}}</onlyinclude>
|}}</onlyinclude>
Line 7: Line 7:
{{clear floats}}
{{clear floats}}


{{Example|<pre>
{{Example|
game:GetService("RunService").Stepped:connect(function()
This code will print <samp>Stepped</samp> every frame.
  print("Stepped")
<syntaxhighlight lang="lua">
game:GetService('RunService').Stepped:connect(function()
print("Stepped")
end)
end)
</pre>}}
</syntaxhighlight>}}
[[Category:Events]]

Latest revision as of 04:36, 27 April 2023

Stepped ( number time, number step )
Description Fired on every "step" in the RunService, a time of approximately 1/30th of a second. The time argument is how long the RunService has been running overall. The step argument seems to always be 1/30, which is an approximation of one frame.
Member of: RunService


Example

This code will print Stepped every frame.

game:GetService('RunService').Stepped:connect(function()
	print("Stepped")
end)