GUI menu won't tween

Hello. I’m a beginner scripter that’s trying to tween a GUI menu once you click a button. Everything works fine but no tweening takes place. I’ve tried defining the easing style, easing direction, and such but even that didn’t work.

Localscript of the button that opens the menu:

local profilemenu = script.Parent
local shopmenu = script.Parent.Parent.shopmenu
local settingsmenu = script.Parent.Parent.settingsmenu

script.Parent.MouseButton1Click:Connect(function(openProfileFunc)
	if profilemenu.Visible == false then
		profilemenu.Visible = true
		profilemenu.TweenPosition(UDim2.new(0.25, 0, 0.124, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Bounce)
		shopmenu.Visible = false
		settingsmenu.Visible = false
	else
		profilemenu.Visible = false
	end
end)

Thanks!

You’ve missed the : , should be profilemenu:TweenPosition

2 Likes

It doesn’t do anything but make the button disappear.

Where is your profilemenu variable?

1 Like

I think this is due to your if statements. Is profilemenu not visible at first? Because if it’s then your first statement would evaluate to true, and everything should be fine. Otherwise, it only makes sense it wouldn’t be visible.

1 Like

It’s in the script but it isn’t showing on the post for some reason.