hello i have a problem where my ui does not rotate correctly on the circle
i want it to keep facing the side of the circle
local current_deg = 0
local speed = 0.5
game:GetService("RunService").Heartbeat:Connect(function()
if not freezing then
current_deg +=speed
script.Parent.Move.Rotation = current_deg
script.Parent.Move.Position = UDim2.new(math.cos(current_deg)*0.5,script.Parent.Size.X.Offset/2,math.sin(current_deg)*0.5,script.Parent.Size.Y.Offset/2)
end
end)
Technically this does work no? It’s just that you’ve been trying to tinker and guess the increments of which it rotates at. Have you tried getting the rotational increments (local speed) based on the Circle’s radius/size in pixels?
Lua’s trig functions require arguments in radians whereas gui.Rotation is in degrees, use math.rad to convert current_deg to degrees before the function calls.