I have a script that when a button is clicked it opens a menu and changes the toggle button's position so that it is visible but changes the position to the top left corner instead of above the menu, how do i fix it?
Openpos = UDim2.new({8.39, 0},{0.543, 0})
ClosePos = UDim2.new({8.39, 0},{0.922, 0})
MenuOpen = false
MenuButton = script.Parent.MenuToggle
MenuFrame = script.Parent.MenuFrame
MenuButton.MouseButton1Click:Connect(function()
if MenuOpen then
MenuOpen = false
MenuButton.Position = ClosePos
MenuButton.Text = "Open Menu"
MenuFrame.Visible = false
elseif not MenuOpen then
MenuOpen = true
MenuButton.Position = Openpos
MenuButton.Text = "Close Menu"
MenuFrame.Visible = true
end
end)

1 comment
If you want to move it in a script then, use tween. If you just want to only change the menu's Position then, just adjust the position to middle. Hope this helpful!