I can't get textlabel to look the same on mobile during tweening

The video above shows a textlabel gliding along the top of the screen to tell the player they have access to exclusive commands, look fine right?

But, as you can see in the video below the textlabel is offscreen and all I’ve done is change devices!

Even when I make the textlabel visible before tweening you can see it goes offscreen when the tweening starts.

I’ve always had a problem with gui elements and getting them to stay consistent on every device, nothing I do seems to work

image
I use AutoScale Lite to scale gui elements but it never works everytime.

Have you tried enabling IgnoreGuiInset?

image
Yes I have done this

Can you provide us your tween script? That way, I can help further.

Also, by any chance are you using Offset instead of Scale while changing the position of the text?
(eg. UDim2.new(0,100,0,100) If so, then you should probably change it to Scale. (eg. UDim2.new(20,0,20,0)

By the way,

This only sets the position/size of the text. If you were to tween it, it would not apply(if you are using Offset instead)

ah yes sorry for the delay, I had school to worry about

local ts = game:GetService("TweenService")

local player = game.Players.LocalPlayer

function tween(caption)
	caption.Position = UDim2.new(0, 0, 0.203, -60)
	caption.Visible = true
	ts:Create(caption, TweenInfo.new(3, Enum.EasingStyle.Circular, Enum.EasingDirection.Out), {Position = UDim2.new(0.5, 0, 0.203, -60)}):Play()
	task.wait(5)
	ts:Create(caption, TweenInfo.new(3, Enum.EasingStyle.Circular, Enum.EasingDirection.In), {Position = UDim2.new(1.4, 0, 0.203, -60)}):Play()
end

return function()
	task.wait(2)

	local playergui = player.PlayerGui
	local mainUI = playergui:WaitForChild("MainUI")
	local mainFrame = mainUI:WaitForChild("MainFrame")
	local caption = mainFrame:WaitForChild("ExclusiveCommands")
	
	tween(caption)
end

and no, i am not using offsets for the position
image

The problem may be caused by

caption.Position = UDim2.new(0, 0, 0.203, -60)
-- UDim2.new(xScale, xOffset, yScale, yOffset)

Using offset may cause the textlabel to exceed the screen.

you were indeed correct! thank you so much for the help it seems like i had most of the positions wrong anyway

1 Like