We use cookies on this site to enhance your user experience

This code sample rotates a parent GuiObject (such as a Frame) using a given rotation speed and the RunService/RenderStepped event.

local RunService = game:GetService("RunService")

local guiObject = script.Parent

local degreesPerSecond = 180

local function onRenderStep(deltaTime)
	local deltaRotation = deltaTime * degreesPerSecond
	guiObject.Rotation = guiObject.Rotation + deltaRotation 
end
RunService.RenderStepped:connect(onRenderStep)