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

How could a make a GUI move form one position to another? (Moving, not teleporting)

Asked by 5 years ago

Honestlyim not shire but I know it has to do with >UDim2>

2 answers

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

This one is pretty easy if you use TweenPosition on a gui object.

If you have a Frame, TextLabel, TextButton, etc inside of a ScreenGui, then you can Tween their position (giving it a movement effect)

Example (Assuming there is a LocalScript inside ScreenGui):

local frame = script.Parent.Frame -- The thing you're moving in the screen gui

frame:TweenPosition(UDim2.new(1,0,1,0), "Out", "Sine", 1) -- The TweenPosition function

That specific function allows you to change the animation for moving the GuiObject, and allows you to change the direction, and time it takes to move. You can also make the animation play backwards by changing "Out" to "In"

For more information, you can refer to this:

https://developer.roblox.com/en-us/api-reference/function/GuiObject/TweenPosition

(copy and paste)

Ad
Log in to vote
0
Answered by 4 years ago

I found it out:

game.StarterGui.ScreenGui.Frame:TweenPosition(UDim2.new(--Anthing in 0,0,0,0--),"Out","Bounce",0.5)

Answer this question