GUI TweenPosition not working

	if not bool then
		local originalX = obj.Position.X.Scale
		obj.Position = UDim2.new(-1,0,obj.Position.Y.Scale,0)
		obj.Parent.Enabled = true
		obj:TweenPosition(UDim2.new(originalX,0,obj.Position.Y.Scale,0),Enum.EasingDirection.Out,Enum.EasingStyle.Exponential,1,true)
		wait(1)
	else
		local originalX = obj.Position.X.Scale
		obj:TweenPosition(UDim2.new(2,0,obj.Position.Y.Scale,0),Enum.EasingDirection.Out,Enum.EasingStyle.Exponential,1,true)
		wait(1)
		obj.Parent.Enabled = false
		obj.Position = UDim2.new(originalX,0,obj.Position.Y.Scale,0)
	end
end

local function tempAchievements() -- temporary function to open up achievements gui
	tempAchievementsButton.Activated:Connect(function()
		guiManager(achievementsGUI.MainFrame,tempAchievementsButton.Parent.Parent.Enabled)
	end)
end

My test case runs the else statement, but instead of it sliding off to the right of the screen, it just moves left a few pixels. Why is this happening?

I strongly suggest moving away from the Tween methods inside GuiObjects. Use TweenService instead, you can animate more properties than just GUI position and size. It’s also easier to read and understand what it’s animating, in my opinion.

1 Like

Currently you are swapping the order of Enums between Enum.EasingDirection and Enum.EasingStyle

Screenshot_25651031_221319

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