GUI Tween not going to right position

Hey, I wrote this code to get the GUI to Tween to the centre of the player’s screen when the prompt is triggered, however, the GUI seems to be veering off to the incorrect position.

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Tool = ReplicatedStorage:WaitForChild("ProductItems"):WaitForChild("Tool")


Prompt.Triggered:Connect(function(Player)
	local Frame = Player.PlayerGui.ProductGui.Frame
	
	if 	Player.PlayerGui.ProductGui.Enabled == false then
		Player.PlayerGui.ProductGui.Enabled = true
		Frame:TweenPosition(UDim2.new({0.33, 0},{0.232, 0}))
		
	end
end)

Video below to demonstrate:

what is its anchor point set too?

It’s set to 0,0. Should it be something else?

No it doesnt need to change I was just wondering cause it can effect the position it goes too.
Is IgnoreGuisnet or whatever the property is called turned on?

There should be no tables involved.

UDim2.fromScale(0.33, 232)

This. For future reference, if you need to use UDim2.new, it accepts 4 optional number arguments or 2 UDim arguments:

UDim2.new(xScale, xOffset, yScale, yOffset)
-- technically works with 1 UDim argument but typed as mandatory
UDim2.new(UDim.new(xScale, xOffset), UDim.new(yScale, yOffset))

try it like this

Frame:TweenPosition(UDim2.new(0.33, 0,0.232,0))

Try this.

local Tool = ReplicatedStorage:WaitForChild("ProductItems"):WaitForChild("Tool")


Prompt.Triggered:Connect(function(Player)
	local Frame = Player.PlayerGui.ProductGui.Frame
	
	if 	Player.PlayerGui.ProductGui.Enabled == false then
		Player.PlayerGui.ProductGui.Enabled = true
                Frame.AnchorPoint = Vector2.new(.5,.5)
		Frame:TweenPosition(UDim2.new({0.5, 0},{0.5, 0}))
		
	end
end)

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