How do I make text move like this?

I’m trying to make a game similar to DOORS and I’ve seen on the Guiding Light screen the text being able to move and I would like to do the same thing for my game. There is a demonstration video below I made in a game called Guiding Light Generator that has the same effect I’m trying to do.

How do I make text do this?

3 Likes

Tween the position of your text.

1 Like

It appears they are using a for loop with a wait() thing in it (I believe it is not TweenService in this case as the movement not smooth), to add and subtract to the position of the textlabel. There also seems to be a small amount of rotation added.

These 2 properties are the relevant ones
image

1 Like

is there a way i can tween the position of the text and use a for loop for the rotation of the text at the same time?

1 Like

Yep! Tween:Play() is non yielding, so you can add the for loop for rotation after it!

1 Like

ok here is the code I came up with and for some reason it only plays the first 2 tweens once but what i’m trying to do is make it play the first 2 tweens first and then as soon as those tweens are done then it plays the other 2 tweens and it repeats infinitely.

Here is my code:

local TweenService = game:GetService("TweenService")

local info = TweenInfo.new(2, Enum.EasingStyle.Linear, Enum.EasingDirection.In, 0, false, 0)

local position1 = UDim2.new(-0.001, 0,0.141, 0)
local position2 = UDim2.new(0.084, 0,0.359, 0)
local rotation1 = -5
local rotation2 = 5

local tweenPos1 = TweenService:Create(script.Parent, info, {Position = position1})
local tweenPos2 = TweenService:Create(script.Parent, info, {Position = position2})
local tweenRot1 = TweenService:Create(script.Parent, info, {Rotation = rotation1})
local tweenRot2 = TweenService:Create(script.Parent, info, {Rotation = rotation2})

while true do
	tweenRot1:Play()
	tweenPos1:Play()
	tweenPos1.Completed:Wait()
	tweenRot2:Play()
	tweenPos2:Play()
	wait()
end
1 Like

In this end part

while true do
	tweenRot1:Play()
	tweenPos1:Play()
	tweenPos1.Completed:Wait()
	tweenRot2:Play()
	tweenPos2:Play()
	wait()
end

replace the last wait() with tweenPos2.Completed:Wait()
i.e.

while true do
	tweenRot1:Play()
	tweenPos1:Play()
	tweenPos1.Completed:Wait()
	tweenRot2:Play()
	tweenPos2:Play()
	tweenPos2.Completed:Wait()
end
1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.