Stepped (Event): Difference between revisions
From Legacy Roblox Wiki
Jump to navigationJump to search
>Legend26 Strangely the second argument never changes and is always 1/30 no matter how much lag. |
m Text replacement - "</SyntaxHighlight>" to "</syntaxhighlight>" |
||
(7 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
<onlyinclude>{{Event|name = Stepped | <onlyinclude>{{Event|name = Stepped | ||
|arguments = [[ | |arguments = [[number]] <var>time</var>, [[number]] <var>step</var> | ||
|description = Fired on every | |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|< | {{Example| | ||
game:GetService( | This code will print <samp>Stepped</samp> every frame. | ||
<syntaxhighlight lang="lua"> | |||
game:GetService('RunService').Stepped:connect(function() | |||
print("Stepped") | |||
end) | end) | ||
</ | </syntaxhighlight>}} | ||
[[Category:Events]] |
Latest revision as of 04:36, 27 April 2023
![]() | |
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)