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

How can I move a GUI Frame with Script(Obviously)?

I don't have any experience with moving GUI or using X-Y with Script..

(Needed more characters to post question)

4 comments

0

Tweening?

0

What's your exact question here? Be more specific.

0

I'd like to move a Frame from ScreenGUI in roblox screen ..

0

I actually explained moving a Frame (Tweening) in an answer to another question previously! Here's the link: https://scriptinghelpers.org/questions/41793/why-does-my-animation-goes-out-of-the-screen-more-you-click-the-button#43563

1 answer

✓ Accepted answer

There are multiple ways to move a GuiObject! The easiest way would definitely be to use Tweening. There is a function for GuiObjects called TweenPosition that will give you a smooth transition - here's the syntax:

[GuiObject]:TweenPosition( [Desired UDim2] , [EasingDirection] , [EasingStyle] , [Time] )



You don't really have to worry about the EasingDirection or EasingStyle arguments most of the time - just input "InOut" and "Linear".

The Desired UDim2 argument is where you want your GuiObject to go to, and the Time argument is how much time the transition should take.

Reference the wiki for descriptions of the arguments if anything is still unclear.

Here's what it would look like in use:

local GuiObject = script.Parent;

GuiObject:TweenPosition(UDim2.new(.5,0,.5,0),"InOut","Linear",1);

######You can read more about Tweening here

1 comment

0

idk why I didn't accepted this answer before,

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