I need help fixing tablet UI

Hello developers! I am WEcompany currently working on mobile support in my game. I have a script that works perfectly well for phones.

local mobile = script.Parent.Parent:WaitForChild("TouchGui")
local mobileframe = mobile:WaitForChild("TouchControlFrame")

local jump = mobileframe.JumpButton
local thumbstick = mobileframe.ThumbstickFrame


jump.Position = UDim2.new(1, -140, 1, -90)
thumbstick.Position = UDim2.new(0, 100,1, -90)

jump.ImageColor3 = Color3.fromRGB(0, 255, 0)
mobileframe.ThumbstickFrame.OuterImage.ImageColor3 = Color3.fromRGB(0, 0, 0)
mobileframe.ThumbstickFrame.StickImage.ImageColor3 = Color3.fromRGB(0, 255, 0)

while wait() do
	thumbstick.Position = UDim2.new(0, 100,1, -90) --This part is to make sure that it goes to this position after the player moves
end

Here is what it looks like on phone:


Perfect :white_check_mark:

Now going into the tablet emulator…


Uhh… What happened here?
If you can help me make a seprate UI for tablets, that would be great :slight_smile: Thanks in advance!
WEcompany

Are you trying to make all the GUIs scaled to appropriate size on all devices?

Im trying to make a separate version/script for tablet. I tried UserInputService but it doesnt work.

What do you mean by separated version? I don’t understand.

What I mean by that is like have one made for phones (The current one) and another for tablets.

Solved. We just modified the script.