Hi, I need to make this scrolling display actually finish the tween movement before disappearing. I highlighted the textlabel as red background for the purpose of letting you all see the problem. Basically, I need a way for the textlabel to get the dimensions of the text (as the scrolling display is made that if the text overflows it scrolls, if not it just stays centered)
#TextLabel tween does not finish
1 messages · Page 1 of 1 (latest)
Example video below
local TweenService = game:GetService("TweenService")
-- Ref
local scrollingFrame = script.Parent.Parent
local text1 = script.Parent.FirstLine
-- CONFIG
local speed = 100 -- pixels per second
local padding = 230 -- gap between text repeats NOT USED FOR THIS EXAMPLE
-- The script should theoretically have two moving texts to have a continous flow, however for this example and to debug, I've removed every part
-- about the second text
while true do
local textWidth = text1.TextBounds.X
local frameWidth = scrollingFrame.AbsoluteSize.X
if #text1.Text > 15 then
-- keep both labels inside the frame
text1.Position = UDim2.new(0, 0, 0, 0)
-- move both left within the visible frame
local distance = textWidth + padding
local duration = distance / speed
-- tween their X offsets only (inside the same frame)
local tween1 = TweenService:Create(
text1,
TweenInfo.new(duration, Enum.EasingStyle.Linear),
{Position = UDim2.new(0, -distance, 0, 0)}
)
tween1:Play()
tween1.Completed:Wait()
-- instantly reset positions for the next cycle
text1.Position = UDim2.new(0, 0, 0, 0)
else
text1.TextXAlignment = Enum.TextXAlignment.Center
end
end
hierarchy for reference
i recreated ur sign and it finished for me, maybe it's your ui sizes
or maybe i dont get the issue :')
all i added to the script was a task.wait(0.1) because you have a while true loop that may or may not crash users
** You are now Level 1! **
@regal falcon
bro i lost my file 1 sec
stops on the red (frame), and your text goes outside your frame
managed to get it working from another person, basically the solution was just to enable automaticsize for the x axis (lol)
