How would I go about scripting an infinitely repeating pattern, for a smaller gui?

Random example video I found: https://www.youtube.com/watch?v=2lnBuukEPs8
While I’ve seen a lot of posts on this, the main problem with them is that they’re gigantic background images, so size isn’t an issue and is therefore used to create the illusion of a repeating background
My problem is that I want a repeating background for a smaller gui (the stars in the background of my chat box)

How would I go about making a moving infinitely repeating pattern, while making sure the image doesn’t clip out of my chatbox?

1 Like

Recursive function.
Each time increase value being sent to a next call of recursive.
Althrough set some limits or you will get stack overflow

And how would i go about doing that exactly

local function Recursive(Level:number):()
--Setting limits
if Level>100 then return end
--

Recursive(Level+1)
end
Recursive(1)

No i know what a recursive function is but i dont see how that applies to what im trying to make

Someone had already made something similar to that

Please reread what i said :sob:

“While I’ve seen a lot of posts on this, the main problem with them is that they’re gigantic background images, so size isn’t an issue and is therefore used to create the illusion of a repeating background
My problem is that I want a repeating background for a smaller gui (the stars in the background of my chat box)”

Try using canvasgroup


You might be able to use a Giant Image, but Clip it in a way that it’s only visible inside the small UI you are talking about.

You could convert the Frame into a CanvasGroup, or turn on ClipsDescendants in the Frame’s properties (I imagine CanvasGroup would be more reliable for this purpose).

And then with some code, you can constantly set the size of the image to the Screen’s pixel size. This way the image will be the same size of the screen, but only the portion inside the button will be visible.

Before Clipping:


After Clipping (turning the Frame into a CanvasGroup):

And then from here you can apply the same technique you said you found in other people’s methods.

Realised this from a friend and forgot to answer it here dont know how i didnt think of that but thanks

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.