I am trying to tween a Gui to a new position on the players screen, but on different size screens it tweens to a different spot, how do i fix this?
local Players = game:GetService("Players")
local Player = Players.LocalPlayer
local PlayerGui = Player:WaitForChild("PlayerGui")
local Main = PlayerGui:WaitForChild("MainUI")
local Open = false
Main.PhoneMain.PhoneToggle.MouseButton1Click:Connect(function()
Open = true
Main.PhoneMain:TweenPosition(
UDim2.new(0, 10,1, -430),
"Out",
"Quad",
.2,
true
)
end)
Main.PhoneMain.OverlayContent.CloseButton.MouseButton1Click:Connect(function()
Open = false
Main.PhoneMain:TweenPosition(
UDim2.new(0, 10,1, -10),
"Out",
"Quad",
.2,
true
)
end)
Main.PhoneMain.PhoneToggle.MouseEnter:Connect(function()
if Open == false then
Main.PhoneMain:TweenPosition(
UDim2.new(0, 10,1, -20),
"Out",
"Quad",
.2,
true
)
end
end)
Main.PhoneMain.PhoneToggle.MouseLeave:Connect(function()
if Open == false then
Main.PhoneMain:TweenPosition(
UDim2.new(0, 10,1, -10),
"Out",
"Quad",
.2,
true
)
end
end)