How can i make the pattern not jitter on different resolutions?

basically i want to make a moving pattern moving across the screen but i want to be dynamic for different screen resolutions and still be seamless, but its based off a certain pos that i’ve managed to find in studio res at the moment but if i emulate a different monitor (e.g a 1920x1080 monitor) you can see the pattern jitter, i’ve tried to divide the scale by -.13 but that didn’t seem to work and instead just sped up the pattern’s speed. Can’t really find a proper solution to this issue, is there any way to dynamically find a screen’s res, divide it by a certain degree then make it tween to that pos whilst making the pattern look seamless/perfect visual match still?

this is the code with the hardcoded distance with the main frame being {1,0},{1,0} and the pattern being {2,0},{2,0}

local bgp = script.Parent
local tweenService = game:GetService("TweenService")

local distance = -.13
local tweenTime = 10

local moveDistance = UDim2.new(distance, 0, distance, 0)

local function loopScroll()
	while task.wait() do
		local tween = tweenService:Create(bgp, TweenInfo.new(tweenTime, Enum.EasingStyle.Linear), {Position = bgp.Position + moveDistance})
		tween:Play()
		tween.Completed:Wait()
		bgp.Position = bgp.Position - moveDistance
	end
end

task.spawn(loopScroll)

Medal_RhDIdAL24Y
this is how the pattern should be looking like, moving diagonally and at this speed and somehow -.13 achieve it without any jitter. Any suggestions or solutions would be great!

1 Like