RunService

非推奨を表示

*このコンテンツは、ベータ版のAI(人工知能)を使用して翻訳されており、エラーが含まれている可能性があります。このページを英語で表示するには、 こちら をクリックしてください。

作成できません
サービス
複製されていません

概要

プロパティ

  • 読み取り専用
    複製されていません
    Robloxのスクリプトセキュリティ
    並列読み取り
  • 複製されていません
    プラグインのセキュリティ
    並列読み取り

方法

プロパティ

ClientGitHash

読み取り専用
複製されていません
Robloxのスクリプトセキュリティ
並列読み取り
複製されていません
プラグインのセキュリティ
並列読み取り

方法

BindToRenderStep

()

パラメータ

name: string
既定値: ""
priority: number
既定値: ""
function: function
既定値: ""

戻り値

()

コードサンプル

Frame Moving in Circle

local RunService = game:GetService("RunService")
-- How fast the frame ought to move
local SPEED = 2
local frame = script.Parent
frame.AnchorPoint = Vector2.new(0.5, 0.5)
-- A simple parametric equation of a circle
-- centered at (0.5, 0.5) with radius (0.5)
local function circle(t)
return 0.5 + math.cos(t) * 0.5, 0.5 + math.sin(t) * 0.5
end
-- Keep track of the current time
local currentTime = 0
local function onRenderStep(deltaTime)
-- Update the current time
currentTime = currentTime + deltaTime * SPEED
-- ...and the frame's position
local x, y = circle(currentTime)
frame.Position = UDim2.new(x, 0, y, 0)
end
-- This is just a visual effect, so use the "Last" priority
RunService:BindToRenderStep("FrameCircle", Enum.RenderPriority.Last.Value, onRenderStep)
--RunService.RenderStepped:Connect(onRenderStep) -- Also works, but not recommended
RunService Custom Function

local RunService = game:GetService("RunService")
local function checkDelta(deltaTime)
print("Time since last render step:", deltaTime)
end
RunService:BindToRenderStep("Check delta", Enum.RenderPriority.First.Value, checkDelta)
Bind and Unbind a Function

local RunService = game:GetService("RunService")
-- Step 1: Declare the function and a name
local NAME = "Print Hello"
local function printHello()
print("Hello")
end
-- Step 2: Bind the function
RunService:BindToRenderStep(NAME, Enum.RenderPriority.First.Value, printHello)
-- Step 3: Unbind the function
RunService:UnbindFromRenderStep(NAME)

IsClient

並列書き込み

戻り値

IsEdit

プラグインのセキュリティ
並列書き込み

戻り値

IsRunMode

並列書き込み

戻り値

IsRunning


戻り値

IsServer

並列書き込み

戻り値

IsStudio

並列書き込み

戻り値

Pause

()
プラグインのセキュリティ

戻り値

()

Run

()
プラグインのセキュリティ

戻り値

()

Stop

()
プラグインのセキュリティ

戻り値

()

UnbindFromRenderStep

()

パラメータ

name: string
既定値: ""

戻り値

()

イベント

Heartbeat

パラメータ

deltaTime: number

PostSimulation

パラメータ

deltaTimeSim: number

PreAnimation

パラメータ

deltaTimeSim: number

PreRender

パラメータ

deltaTimeRender: number

PreSimulation

パラメータ

deltaTimeSim: number

RenderStepped

パラメータ

deltaTime: number

Stepped

パラメータ

time: number
deltaTime: number