Open Asterune
RunService

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

Members19
Properties2
Methods11
  • BindRender(priority: number, callback: function): RenderBindingserial only

    Registers a render callback at the specified numeric priority and returns a RenderBinding.

  • Returns this instance if it is an ExecutionGroup.

  • GetFixedAlpha(): numberparallel read

    Returns the interpolation fraction between fixed physics states.

  • GetFixedTick(): numberparallel read

    Returns the current fixed physics tick counter.

  • GetSchedule(): tableparallel read

    Returns the ECS schedule report, including phase order, System timings, component reads and writes, and recorded conflicts.

  • IsClient(): booleanparallel read

    Returns whether the current code is executing on a client.

  • IsEdit(): booleanparallel read

    Returns whether the engine is in edit mode.

  • IsRunMode(): booleanparallel read

    Returns whether the engine is running a simulation.

  • IsRunning(): booleanparallel read

    Returns whether the simulation is currently running.

  • IsServer(): booleanparallel read

    Returns whether the current code is executing on the server.

  • IsStudio(): booleanparallel read

    Returns whether the code is executing in Studio.

Events6

Properties

FixedDeltaTime

RunService.FixedDeltaTime: number

The duration of one fixed physics tick, in seconds.

FixedTickRate

RunService.FixedTickRate: number

The fixed physics update rate, in ticks per second.

Methods

BindRender

RunService:BindRender(priority: number, callback: function): RenderBinding

Registers 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(): number

Returns the interpolation fraction between fixed physics states.

GetFixedTick

RunService:GetFixedTick(): number

Returns the current fixed physics tick counter.

GetSchedule

RunService:GetSchedule(): table

Returns the ECS schedule report, including phase order, System timings, component reads and writes, and recorded conflicts.

IsClient

RunService:IsClient(): boolean

Returns whether the current code is executing on a client.

IsEdit

RunService:IsEdit(): boolean

Returns whether the engine is in edit mode.

IsRunMode

RunService:IsRunMode(): boolean

Returns whether the engine is running a simulation.

IsRunning

RunService:IsRunning(): boolean

Returns whether the simulation is currently running.

IsServer

RunService:IsServer(): boolean

Returns whether the current code is executing on the server.

IsStudio

RunService:IsStudio(): boolean

Returns whether the code is executing in Studio.

Events

FixedPostSimulation

RunService.FixedPostSimulation: RBXScriptSignal

Fires after each fixed physics tick.

FixedPreSimulation

RunService.FixedPreSimulation: RBXScriptSignal

Fires before each fixed physics tick.

PostSimulation

RunService.PostSimulation: RBXScriptSignal

Fires 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: RBXScriptSignal

Fires before animation evaluation for the frame.

PreRender

RunService.PreRender: RBXScriptSignal

Fires before the frame is drawn. Keep this work short because it is on the rendering path.

PreSimulation

RunService.PreSimulation: RBXScriptSignal

Fires before physics steps. Use it for work that must influence the simulation this frame.

Inherited members

Inherited47

Example

Luau
local RunService = game:GetService("RunService")
print(RunService:IsServer())

TweenService · Workspace