Gui:TweenPosition, wont return to its original position

  1. What do you want to achieve? I have a gamepass UI and I want to tween it out on the screen and then when the player clicks the button while its open it will close by tweening back to it original position off the screen.

  2. What is the issue? It tweens out on the screen but it doesnt tween back to the original position

  3. What solutions have you tried so far? Right now im working with bool values and its working but the tween wont play.

script.Parent.ImageLabel.GamepassesButton.MouseButton1Click:Connect(function()
	if not isOpen2 then -- the gui is off the screen
		isOpen2 = true
		script.Parent.ImageLabel.Gamepasses.Visible = true
		script.Parent.ImageLabel.Gamepasses:TweenPosition(UDim2.new({0.697, 0},{0.05, 0}),"Out")
		rs.Click:Play()
	else -- the gui is on the screen

		script.Parent.ImageLabel.Gamepasses:TweenPosition(UDim2.new({-3.691, 0},{0.058, 0}),"Out")
		isOpen2 = false
	end
end)

UDim2.new takes in 4 parameters. You need to remove the {} brackets
:TweenPosition(UDim2.new(0.697, 0,0.05, 0),"Out")

1 Like

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