Every frame
Make it move on its own. Connect a function to Root.Heartbeat and Stroke calls it on every frame; here it turns the statue, slowly and smoothly.
In development, not released yet.
You'll learnRoot.Heartbeat, delta time, where a per-frame script lives, how it stops
Connect to Heartbeat
Root.Heartbeat is an event like Roblox's Heartbeat: :Connect(fn) calls fn(dt) once a frame while scripts run, with dt the seconds since the frame before.
You know this asRoblox StudioRunService.Heartbeat
- In Explorer, right-click Showcase > Insert > Scripts > InitScript.
- Press F2, type Spin and press Enter.
- Double-click Spin: a new InitScript already holds a
Root.Heartbeat:Connect. - Replace its code with this.
-- Spin: turns the statue a little every frame.
local statue = Root.Studio.Statue
local start = statue.CFrame
local speed = 0.4 -- radians a second
local turned = 0
Root.Heartbeat:Connect(function(dt)
turned += dt * speed
statue.CFrame = start * CFrame.Angles(0, turned, 0)
end)turned grows by dt times speed, so the statue turns at the same rate at 30 or 144 frames a second. Setting the CFrame from start each frame, never from the last one, keeps it from drifting.
Why it lives in the video
A video is a Sandbox too, and a render runs the video's own scripts on the video's clock. There, dt is one frame of the video (1/30 s at 30 fps), so the turn matches the timeline.
Tip A render that starts late in the video first runs the earlier frames without drawing them, so turned arrives at the right angle. Keep per-frame state in Heartbeat, use dt, and every render agrees.
Film the ring too
A render from Edit runs only the scripts of the video it renders, so the Orbs ring stays out of it until its script lives in the video.
- Drag Init from Orbs onto Showcase.
How it stops
ShiftF5 disconnects every connection and puts the statue back where it was: Output says Stopped: put back 1 value the scripts changed. To stop it sooner, keep what :Connect returns and call :Disconnect() on it.
Try it While playing, set speed to 2, click the viewport and press Q: Spin restarts at the new speed, and nothing else does.
