GUI Frame gets tweened to the incorrect position despite the correct position given

I’ll start with the GUI itself.

This is where the frame is supposed to be.

But uhhhh, this happens instead

Incase this helps, here’s the explorer:
image

And code:

local plr = game:GetService("Players").LocalPlayer
local weaponryGui = plr.PlayerGui:WaitForChild("ScreenGui").pickweapon.WeaponryButton.weaponry
local boingSound = plr.PlayerGui:WaitForChild("ScreenGui").pickweapon.WeaponryButton.boing
local TS = game:GetService("TweenService")

script.Parent.MouseButton1Click:Connect(function()
	local time = 1
	boingSound:Play()
	local tween = TS:Create(weaponryGui, TweenInfo.new(time, Enum.EasingStyle.Bounce, Enum.EasingDirection.In), {Position = UDim2.new({6.25, 0},{-1.51, 0})})
	
	tween:Play()
end)
1 Like

remove the Curly brackets. ex: UDim2.new(6.25, 0,-1.51, 0)

1 Like

There is something call Gui:TweenPosition() you can use that instead
and like the above guy said (idk how to mention someone sobs) you should remove those brackets as studio will consider it as 0,0,0,0

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