My advice would be to use a texture as they are infinite. What you can do is set up a part, position it in front of the camera where you want it and edit the TextureOffsetStuds to move the image.
This will give you a seamless scrolling effect that is infinite
Managed to solve it and achieved what I want with just moving images looping!
I had to have two copies of the image and merge them together where it both ends.
local RunService = game:GetService("RunService")
local guiInset = game:GetService("GuiService"):GetGuiInset()
local SCREENUI = script.Parent
local SPEED = 200
local p1 = SCREENUI:WaitForChild("Horizontal_Image_Panel")
local p2 = SCREENUI:WaitForChild("Horizontal_Image_Panel_2")
task.wait()
local yScale, yOffset = p1.Position.Y.Scale, p1.Position.Y.Offset
p1.Position = UDim2.new(0, 0, yScale, yOffset)
p2.Position = UDim2.new(0, p1.AbsoluteSize.X, yScale, yOffset)
local function isOffScreen(panel)
local pos = panel.AbsolutePosition + guiInset
local size = panel.AbsoluteSize
local viewport = workspace.CurrentCamera.ViewportSize
return pos.X + size.X <= 0
end
RunService.RenderStepped:Connect(function(dt)
-- Move panels individually
for _, panel in ipairs({p1, p2}) do
panel.Position = panel.Position + UDim2.new(0, -SPEED * dt, 0, 0)
if isOffScreen(panel) then
local otherPanel = (panel == p1) and p2 or p1
panel.Position = UDim2.new(
0,
otherPanel.Position.X.Offset + otherPanel.AbsoluteSize.X - 85,
yScale,
yOffset
)
end
end
end)
This is what I meant having them merged before hand