Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Why is this tweening so slow?

So i want it to bounce sideways when you hover over the gui. but the tween is slow and doesnt bounce

for i,gui in pairs(script.Parent:GetChildren()) do
	if gui:IsA("Frame") then
		gui.MouseEnter:connect(function()
			gui:TweenPosition(UDim2.new(-.02,0,gui.Position.Y.Scale,0,"Out"
,"Elastic",.5,true))
		end)
		gui.MouseLeave:connect(function()
			gui:TweenPosition(UDim2.new(-0.039,0,gui.Position.Y.Scale,0,"Out"
,"Elastic",.5,true))
		end)
	end
end

EDIT: Changing the speed seems to do nothing

2 answers

✓ Accepted answer

Lines 4 and 8 both have misplaced parenthesis:

for i,gui in pairs(script.Parent:GetChildren()) do
    if gui:IsA("Frame") then
        gui.MouseEnter:connect(function()
            gui:TweenPosition(UDim2.new(-.02,0,gui.Position.Y.Scale,0),"Out"
,"Elastic",.5,true)
        end)
        gui.MouseLeave:connect(function()
            gui:TweenPosition(UDim2.new(-0.039,0,gui.Position.Y.Scale,0),"Out"
,"Elastic",.5,true)
        end)
    end
end

This should work, hope I helped!

1 comment

1

THANKS! Never would have guessed!

I'm not sure if you did this already but here.

for i,gui in pairs(script.Parent:GetChildren()) do
    if gui:IsA("Frame") then
        gui.MouseEnter:connect(function()
            gui:TweenPosition(UDim2.new(-.02,0,gui.Position.Y.Scale,0.4,"Out"
,"Elastic",.5,true))
        end)
        gui.MouseLeave:connect(function()
            gui:TweenPosition(UDim2.new(-0.039,0,gui.Position.Y.Scale,0.4,"Out"
,"Elastic",.5,true))
        end)
    end
end


1 comment

0

ya i did, it didnt work

This discussion is preserved as it was. New answers, comments, and votes are closed.