How do i make a gui rotate back and forth?

Hello im making a menu screen gui and i want my title to rotate back and forth like this sorta
robloxapp-20210711-0634205.wmv (739.9 KB)
Ive thought of ways i could do it like using a while loop but then i figured out it probably wouldnt be smooth so im asking how to do it.

1 Like

It’s basically using tweens from TweenService and smoothly changing the Rotation property.

1 Like

How though? Im a beginner scripter and i havent looked into tweenservice yet only gui tweens.

I guess TweenPosition works pretty well too.

1 Like

How would TweenPosition work if it needs to be rotated?

Uf, good guess. Then just use TweenService, the link is for the documentation. If that not helps, browse other topics. I can’t really help with the code right now since I am on mobile plus I don’t know Tweening very well.

1 Like

Gui actually have a property called orientation or rotation GuiObject | Roblox Creator Documentation you can use tweenservice on it to rotate it

1 Like

I know that but how would i make it rotate 5 degrees then rotate -5 degrees smoothly?
And make it loop

local Gui = ---ur gui
local tweenInfo = TweenInfo.new(5) --your tween info 

    local tween1 =  game:GetService("TweenService"):Create(Gui, tweenInfo,{Rotation = Udim2.new(5,0)})
     local tween2 =  game:GetService("TweenService"):Create(Gui, tweenInfo,{Rotation = Udim2.new(-5,0)})

    tween1:Play()
    tween1.Completed:Connect(function()
        tween2:Play()
    end)     
    tween2.Completed:Connect(function()
        tween1:Play()
    end)

basicaly this script will create a loop

2 Likes

Ok i theres a error now
07:00:41.266 TweenService:Create property named ‘Rotation’ cannot be tweened due to type mismatch (property is a ‘float’, but given type is ‘UDim2’) - Client - LocalScript:4
Im guessing this means since rotation is a single number value not 1,0
And i did correct the misspelled UDim2

Remove udim2, and the ,0 and it’ll work

my bad its actually a single number just remove the Udim2 and just add 5 or -5

2 Likes

It works! Yay! Thank you heres it in action
robloxapp-20210711-0707106.wmv (2.0 MB)
Thanks again!

1 Like