Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

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

Asked by 6 years ago

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

(Needed more characters to post question)

0
Tweening? DrPredablox 153 — 6y
0
What's your exact question here? Be more specific. flufffybuns 89 — 6y
0
I'd like to move a Frame from ScreenGUI in roblox screen .. User#17685 0 — 6y
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 Troidit 253 — 6y

1 answer

Log in to vote
1
Answered by
Goulstem 8144 Badge of Merit Moderation Voter Administrator Community Moderator
6 years ago
Edited 6 years ago

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
0
idk why I didn't accepted this answer before, User#17685 0 — 4y
Ad

Answer this question