Log in to vote

How to make a gui move?

Asked by 7 years ago

When I make a change name gui for my fort I cannot figure out how to make a different gui move when you click a button on another gui.

Example: My Change Team gui is on the right side, with only that part of the gui. When I click the Change Name gui then two gui's move from off the screen, to on the screen. When I click the Change Team gui again, the new gui's move off the screen.

2 answers

Log in to vote
Answered by 7 years ago

You should use the TweenPosition method. This will animate a change in the position of the GUI. For example:

local Gui = script.Parent
Gui:TweenPosition(UDim2.new(0, 0, 0, 0))

would animate the parent of the script's position to the top left corner of the screen. You can specify other arguments, including the animation direction, the style of the animation, the time it takes to complete the animation, and whether it can be overridden by another animation. A guide to tweening can be found on the wiki.

Log in to vote
Answered by
Marolex 45
7 years ago

Can you give the code of the Gui?

Answer this question