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.
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.
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