Any Ideas on how to make a moving background GUI

Hi, Basically I want to have a start screen with a moving back ground GUI.

So I want to tween the GUI from right to left. but for some reason it goes to the top left, I think the udim I put in is incorrect but now sure, also I think cloning is needed so the background is seen at all time, again not to sure tho.


local gui = script.Parent.Background

while true do

I don’t have much experience with guis, tweening, Cframes etc.

screenshot of my problem:

1 Like

Do you mean you want the UI to go from the middle of the screen to the left of the screen? From off the screen to the right to off the screen of the left? Could you maybe provide a visual?

Basically its a start screen that will keep on moving from right to left.


So basically, you’d want to slowly tween it from left to right.

local gui = script.Parent.Background
gui.AnchorPoint =,0.5) -- just makes it easier
gui.Position =,0,0.5,0) -- UDim2's contain 4 values, not 3; Scale X, Offset X, Scale Y, Offset Y respectively.

local tweenService = game:GetService('TweenService')
tweenService:Create(gui,,Enum.EasingStyle.Linear), {Position =,0,0.5,0)}):Play()

You should also probably take a look into TweenService docs if you haven’t already.


How would I make this keep on going? I think it involves cloning. Basically I don’t want the player to himself

You could probably do it with a loop that makes a new frame each time the tween ends. Since we’re using the EasingType linear it wouldn’t really look like it’s ever stopping.

Try this, it should give an illusion of an infinitely scrolling background:

local tweenService = game:GetService('TweenService')
local baseFrame = script.Parent.Background

local oldFrame = baseFrame
local newFrame = baseFrame:Clone()
newFrame.Parent = baseFrame.Parent
while true do
	newFrame.Position =,0,0,0)
	oldFrame.Position =,0,0,0)
	local tween1 = tweenService:Create(newFrame,, Enum.EasingStyle.Linear), {Position =,0,0,0)})
	local tween2 = tweenService:Create(oldFrame,, Enum.EasingStyle.Linear), {Position =,0,0,0)})
	oldFrame = newFrame
	newFrame = oldFrame:Clone()
	newFrame.Parent = oldFrame.Parent
	newFrame.Position =,0,0,0)

the gui for some reason is higher then it should be and also it’s not after teen it stops, for some reason its not a loop :frowning:

Switch the AnchorPoint back to 0,0 I also made an edit to the post, the new code should work.

THANKS A LOT :slight_smile: :slight_smile:

1 Like