Tweening text rotation

I’m attempting to rotate the text in textlabel, repeating itself to go -5 and 5, giving it a smooth effect - but it doesn’t seem to work out, and by this, it doesn’t operate at all. What’s the concurrent issue here? I have been given no error in the output neither any proper research for my inquiry. Here’s the code:

local label = script.Parent
local ts = game:GetService("TweenService")
local ti = TweenInfo.new(2, Enum.EasingStyle.Quart, Enum.EasingDirection.InOut, 0, true, 2)
local prop = {Rotation = -5} -- current rotation is set to 5
ts:Create(label, ti, prop)

If you have anything to elaborate on for me to acknowledge, please feel free to inform me in your feedback.

3 Likes

Alright, so from what you coded, you weren’t playing the tween to begin with and you didn’t have it in any sort of loop which would reverse the rotation, so I coded a solution for you below. For it to work, make sure the TextLabel’s initial rotation is set to 5 or whatever you like.

local TweenService = game:GetService("TweenService")

local label = script.Parent

local function rotateText()
    local tweenInfo = TweenInfo.new(2, Enum.EasingStyle.Quart, Enum.EasingDirection.InOut, 0, true, 2)
    local goal = {Rotation = math.abs(script.Parent.Rotation) * -1} -- This will reverse the rotation
    local tween = TweenService:Create(label, tweenInfo, goal)
    tween:Play()
    tween.Completed:Connect(rotateText)		
end

rotateText()
2 Likes

Hi, is there a way to rotate the individual letters, so they like come out one by one on a line, to rotate / roll into position of the full word / text , like each letter one at a time, spins to the final text…

Thanks!

1 Like

I don’t think so… Maybe try to make each letter into a text label and rotate them one by one but I think that’s going to be really long.