Need help Rotating a TextLabel

Hello,

I’m trying to achive this Tween with a TextLabel (see video), but I’m having some hard times coding it.

I’ve tried the following:

local t1 = TweenService:Create(complimentText, TweenInfo.new(0.5), {Rotation = 15})
local t2 = TweenService:Create(complimentText, TweenInfo.new(0.5), {Rotation = -15})

for i = 1, 10, 1 do
	t1:Play()
	t1.Completed:Connect(function()
		wait(0.25)
		t2:Play()
	end)
	wait(1)
end

But it is buggy and doesn’t work the way I expected. Can you help me?

What seems to be the problem exactly? It looks great in the video.

local t1 = TweenService:Create(complimentText, TweenInfo.new(0.5), {Rotation = 15})
local t2 = TweenService:Create(complimentText, TweenInfo.new(0.5), {Rotation = -15})

for i = 1, 10, 1 do
	t1:Play()
	t1.Completed:Connect(function()
		wait(0.25)
		t2:Play()
	end)
	wait(1)
        if count >= 10 then 
         complimentText.Rotation = 0
        end
end

The problem is me not knowing how to really code it. The video is what I want to intimidate.

if u want the same in the video: change wait(1) to wait() or wait(0.5) – lower more faster

Alright, I’m trying this right now.

also remove the wait(0.25) after completed function!

	t1.Completed:Connect(function()
		wait(0.25)

This is the best it gets:

for i = 1, 10, 1 do
	t1:Play()
	t1.Completed:Connect(function()
		wait()
		t2:Play()
	end)
	wait(0.5)
	if count >= 10 then 
		complimentText.Rotation = 0
	end
end

But it still stops for a visible amount of time before tweening it again, I’ve also tried using RenderStepped but that makes it buggy.

local num = 15

local t1 = TweenService:Create(complimentText, TweenInfo.new(0.5), {Rotation = num})
local t2 = TweenService:Create(complimentText, TweenInfo.new(0.5), {Rotation = -num})

for i = 1, 10, 1 do
	t1:Play()
	t1.Completed:Connect(function()
		num = 30
		t2:Play()
	end)
	wait(0.3) -- change this to whatever u like: wait() wait(0.5) any... i'm not sure
        if count >= 10 then 
         complimentText.Rotation = 0
         num = 15
        end
end

Alright, I will test it out now.

1 Like

That doesn’t really work.
I tried this:



local t1 = TweenService:Create(complimentText, TweenInfo.new(0.5), {Rotation = 15})
local t2 = TweenService:Create(complimentText, TweenInfo.new(0.5), {Rotation = -15})
local count = 0

for i = 1, 10, 1 do
	t1:Play()
	t1.Completed:Connect(function()
		RunService.RenderStepped:Wait()
		t2:Play()
	end)
	wait(0.5)
	if count >= 10 then 
		complimentText.Rotation = 0
	end
end

It works faster but you can still see it waiting a bit.

replace count > i because it’s for i…

I am not so sure what you mean with that.

local num = 15

local t1 = TweenService:Create(complimentText, TweenInfo.new(0.25), {Rotation = num})
local t2 = TweenService:Create(complimentText, TweenInfo.new(0.25), {Rotation = -num})

for i = 1, 10, 1 do
	t1:Play()
	t1.Completed:Connect(function()
		num = 30
		t2:Play()
	end)
	wait(0.5) 
	if i >= 10 then 
		complimentText.Rotation = 0
		num = 15
	end
end
2 Likes

This worked. Thank you for helping!

1 Like
local t = TweenService:Create(complimentText, TweenInfo.new(0.25, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, 0, true), {Rotation = 15})
complimentText.Rotation = -15

for i = 1, 10, 1 do
	t:Play()
	t.Completed:Wait()
	task.wait(0.5) --Increase/decrease this if necessary.
end

complimentText.Rotation = 0
1 Like