Make Background Tween Effect Seamless

Hey There! I’m currently trying to make an infinite background tween effect.

Here is my current code:

My Script
local screenGui = script.Parent
local bgFr = screenGui:WaitForChild("BackFrame")
local fxFr = screenGui:WaitForChild("EffectFrame")
local TS = game:GetService("TweenService")
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.All, false)

local config = {
	TweenTime = 20
}
function Tween(obj,prop,info) -- object to animate, properties to change, tween info.
	info = info or TweenInfo.new(
		config.TweenTime,
		Enum.EasingStyle.Linear,
		Enum.EasingDirection.Out,
		-1,
		true,
		0
	)
	TS:Create(obj,info,prop):Play()
end

while true do
	fxFr.Position = UDim2.new(0,0,1,0)
	Tween( fxFr,  { Position = UDim2.new(1, 0, 0, 0) } )
	wait(config.TweenTime)
end

It currently Just bounces back instantly, but i want it to make it look like it is just infinite.

If you want the screenGUI file, here it is:
effectTween.rbxm (5.9 KB)
Thanks for the help!

The Change.rbxm (5.9 KB)
I tried changing the tween but I think this loops. :slight_smile:

1 Like

Works!

I’m really sorry but I changed some things and now it doesn’t work again lol sorry for making u work alot. I’m not super good at tweening.

File:
newTweenEffect.rbxm (6.0 KB)

Here:
The Change.rbxm (6.0 KB)
Glad to help :slight_smile:

Still Doesn’t Work…

Think we can move this to messages so we don’t clog this up?

Try making a pattern image with the same positions on both sides then looping it.

After messing with it for a bit, I managed to make it work with a little bit of trial and error with the anchor point. I also switched it from a frame with loads of ImageLabels to a single ImageLabel with a Tile SliceType, so it’s a bit more efficient. It doesn’t have the tile padding it had before, but you could reupload a smaller version the image if you need it.

File:
effectTween.rbxm (30.5 KB)