How to make Scrolling SurfaceGui Text?

Hello everyone. My issue is the following: I have been trying to make a broadcast system, and am doing pretty good. The only thing is that I’m new to GUI, and am having a bit of trouble trying to make a scrolling text feature as you would see on the news.

https://gyazo.com/89556a543032e43dfe9764e63863fe6d

See how it doesn’t continue and just resets? How do I avoid this?

Well you can tween the text completely off the screen, then reset the position to the start is it loops.

Example:

local textGUI = script.Parent -- the text label
local ogPos = textGUI.Position -- the original position

local endPos = Udim2.new(-1,0,0,0) -- the end position
local dur = 1 -- Tween duration in seconds.

function tweenText()
    textGUI:TweenPosition(endPos, Enum.EasingDirection.Out, Enum.EasingStyle.Linear, dur) -- tween the gui across the screen
    task.wait(dur) -- wait the duration
    textGUI.Position = ogPos -- Set back position
    tweenText() -- Restart
end

tweenText() -- Call the function to start!

This one basically does the same thing. It resets un-smoothly (cant think of the right word). Thanks.

https://gyazo.com/b79a25b0de49318b5c134d87b78c6ab4

Make sure that the starting position of the text is off the screen (something like 1,0,0,0)

1 Like