RunService
Provides frame update signals and execution-context checks.
- Service
game:GetService("RunService")- Inherits
- Instance
- Replication
- Never
Behavior
RunService exposes frame update signals and methods for checking whether code
is running on the server, a client, or in Studio.
Update callbacks receive elapsed time in seconds. Multiply rates by elapsed time for frame-rate-independent updates.
Summary
The duration of one fixed physics tick, in seconds.
The fixed physics update rate, in ticks per second.
Registers a render callback at the specified numeric priority and returns a RenderBinding.
Returns this instance if it is an ExecutionGroup.
Returns the interpolation fraction between fixed physics states.
Returns the current fixed physics tick counter.
Returns the ECS schedule report, including phase order, System timings, component reads and writes, and recorded conflicts.
Returns whether the current code is executing on a client.
Returns whether the engine is in edit mode.
Returns whether the engine is running a simulation.
Returns whether the simulation is currently running.
Returns whether the current code is executing on the server.
Returns whether the code is executing in Studio.
Fires after each fixed physics tick.
Fires before each fixed physics tick.
Fires after physics has stepped.
Fires before animation evaluation for the frame.
Fires before the frame is drawn.
Fires before physics steps.
Properties
FixedDeltaTime
RunService.FixedDeltaTime: numberThe duration of one fixed physics tick, in seconds.
FixedTickRate
RunService.FixedTickRate: numberThe fixed physics update rate, in ticks per second.
Methods
BindRender
RunService:BindRender(priority: number, callback: function): RenderBindingRegisters a render callback at the specified numeric priority and returns a RenderBinding. Call Disconnect on the binding to remove the callback.
GetExecutionGroup
RunService:GetExecutionGroup(): ExecutionGroup?Returns this instance if it is an ExecutionGroup. Otherwise returns the nearest ancestor ExecutionGroup, or nil when no group contains the instance.
GetFixedAlpha
RunService:GetFixedAlpha(): numberReturns the interpolation fraction between fixed physics states.
GetFixedTick
RunService:GetFixedTick(): numberReturns the current fixed physics tick counter.
GetSchedule
RunService:GetSchedule(): tableReturns the ECS schedule report, including phase order, System timings, component reads and writes, and recorded conflicts.
IsClient
RunService:IsClient(): booleanReturns whether the current code is executing on a client.
IsEdit
RunService:IsEdit(): booleanReturns whether the engine is in edit mode.
IsRunMode
RunService:IsRunMode(): booleanReturns whether the engine is running a simulation.
IsRunning
RunService:IsRunning(): booleanReturns whether the simulation is currently running.
IsServer
RunService:IsServer(): booleanReturns whether the current code is executing on the server.
IsStudio
RunService:IsStudio(): booleanReturns whether the code is executing in Studio.
Events
FixedPostSimulation
RunService.FixedPostSimulation: RBXScriptSignalFires after each fixed physics tick.
FixedPreSimulation
RunService.FixedPreSimulation: RBXScriptSignalFires before each fixed physics tick.
PostSimulation
RunService.PostSimulation: RBXScriptSignalFires after physics has stepped. Use it for work that reacts to the completed simulation rather than changing it before the next step.
PreAnimation
RunService.PreAnimation: RBXScriptSignalFires before animation evaluation for the frame.
PreRender
RunService.PreRender: RBXScriptSignalFires before the frame is drawn. Keep this work short because it is on the rendering path.
PreSimulation
RunService.PreSimulation: RBXScriptSignalFires before physics steps. Use it for work that must influence the simulation this frame.
Inherited members
- Properties
- ArchivableClassNameNameParent
- Methods
- AddComponent()AddTag()ClearAllChildren()ClearTags()Clone()Destroy()FindFirstAncestor()FindFirstAncestorOfClass()FindFirstAncestorWhichIsA()FindFirstChild()FindFirstChildOfClass()FindFirstChildWhichIsA()FindFirstDescendant()GetAttribute()GetAttributeChangedSignal()GetAttributes()GetChildren()GetComponent()GetComponentChangedSignal()GetComponents()GetDebugId()GetDescendants()GetFullName()GetPropertyChangedSignal()GetReferencing()GetTags()HasComponent()HasTag()IsA()IsAncestorOf()IsDescendantOf()RemoveComponent()RemoveTag()SetAttribute()WaitForChild()
- Events
- AncestryChangedAttributeChangedChangedChildAddedChildRemovedDescendantAddedDescendantRemovingDestroying
Example
local RunService = game:GetService("RunService")
print(RunService:IsServer())