Screen size scaling

I made text move with TweenService.

local TweenService = game:GetService("TweenService")

local label = script.Parent -- Assuming the script is a child of the TextLabel

-- Set the initial position of the TextLabel
label.Position =, 700, 0, 835)

-- Function to move the label left and right
local function moveLabel()
	-- Define the initial and target positions
	local startPos =, 700, 0, 835)
	local endPos =, 690, 0, 835)

	-- Create tweens for moving to the end position and back to the start position
	local tweenInfo1 =, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut)
	local tweenInfo2 =, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut)

	local tweenTo = TweenService:Create(label, tweenInfo1, {Position = endPos})
	local tweenBack = TweenService:Create(label, tweenInfo2, {Position = startPos})

	-- Connect the Completed event of the first tween to play the second tween

	-- Connect the Completed event of the second tween to restart the animation
		label.Position = startPos

	-- Play the first tween to start the animation
-- Start the animation

But when screen resolution changes, it looks broken. It goes into an off position if it’s not 1920x1080

This is because offset will only look good on one specific resolution. To fix this issue you need to use scale. (You will probably have to re-scale your GUI in that case)

Ok, noted. I always mess up with GUI since it’s so difficult compared to unity aaaa in unity i click a few buttons to make it scale

A little tip, when you first make the ui object, you can go into properties and make the size & position of the frame in scale, then after that you can resize it and move it around with worrying about scale.

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