Hey! I’ve been having some problems with tweening GUI’s and I was wondering if anyone else had a similar issue. In a game that I’m working on, we have an audio visualizer. I added in a close and open button for it and used InOut and Back for the tweening of the closing/opening animation. When I tested this out, I found that the GUI was tweening, but it a very peculiar way.
Here is what I mean:
In this video, you can see that I press the button to close and open it. In the middle of the tween, you can see that it kind of glitches back and continues the tween. I’ve tried other tween styles and directions and they seem to work fine. I doubt this is a Roblox bug but if anyone has help or feedback they could offer me, I would really appreciate it!
Here is the open/close button’s code (extremely simple):
-- Variables --
local Main = script.Parent.Parent.Main
local Control = script.Parent
local Open = true
-- Scripts --
Control.MouseButton1Click:Connect(function()
if Open == true then -- close
Main:TweenPosition(UDim2.new(1, 0,0.68, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Back)
Control:TweenPosition(UDim2.new(0.98, 0,0.754, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Back)
Control.Text = "<"
Open = false
else -- open
Main:TweenPosition(UDim2.new(0.755, 0,0.68, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Back)
Control:TweenPosition(UDim2.new(0.73, 0,0.754, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Back)
Control.Text = ">"
Open = true
end
end)
Here’s how it’s setup: