Render Loop and Tweens
Drive frame updates, fixed simulation, and property animation.
Render Loop and Tweens
Per-frame work
local RunService = game:GetService("RunService")
RunService.RenderStepped:Connect(function(dt)
-- visual/frame work
end)
RunService.Heartbeat:Connect(function(dt)
-- heartbeat work
end)For ordered render work:
RunService:BindToRenderStep("CameraUpdate", 100, function(dt)
-- runs according to ascending priority
end)Fixed-step simulation
Kinemium's current RunService advances simulation at 1 / 60 seconds per fixed tick.
RunService:BindToSimulation(function(dt)
-- deterministic fixed-step simulation
end)Tweens
local TweenService = game:GetService("TweenService")
local tween = TweenService:Create(part, tweenInfo, {
Position = Vector3.new(0, 20, 0),
})
tween.Completed:Connect(function(state)
print("Tween finished:", state)
end)
tween:Play()Tweened table values need a Lerp method; numbers are interpolated directly.