Still have questions? Join our Discord server and get real time help.
Log in to vote

How do i change the position of a Gui object smoothly?

Asked by 13 days ago

I know you have to use :TweenPosition or something but idk how to do it. Help?

._. thx mewant_taco 17 — 13d

2 answers

Log in to vote
Answered by
Miniller 336 Moderation Voter
13 days ago
Edited 12 days ago

Just an easy example for TweenPosition (local script at StarterCharacterScripts, but with RemoteEvents (in a Filtering Enabled game) can be in a normal script):

local player = game.Players.LocalPlayer
local clone = game.ReplicatedStorage.ScreenGui:Clone()
clone.Parent = player.PlayerGui
player.PlayerGui.ScreenGui.Frame:TweenPosition(, -50, 0.5, -50), Enum.EasingDirection.Out, Enum.EasingStyle.Bounce)

line 04 is what you need, that's the example for TweenPosition.

EDIT: Point of this all is TweenPosition, and the link.

Hope this helps

Thx it helped a lot! mewant_taco 17 — 13d
Log in to vote
Answered by 13 days ago
Edited 12 days ago

If you want to smoothly move a GUI, use, if you want to modify the style of the movement, then visit this article on the different styles of movement -]

This has to be done in a Local Script, otherwise, the script will not play.

Here is how you could move a GUI, for example, using a TextButton to perform the task.

script.Parent.MouseButton1Click:Connect(function() -- When the text button is clicked.
    print("Clicked") -- Just a message to tell you if it's working or not.
    script.Parent:TweenPosition(, 0, -5, 0), Enum.EasingDirection.In, Enum.EasingStyle.Quart) -- Visit the linked article in this post to see what style fits your preference best!

--[[ (Number xScale, Number xOffset, Number yScale, Number yOffset)) This is the number order within the parenthesis]]--


If this is the answer to your question, please feel free to let me know! I hope this helps you!

I don't agree that this has to be in a LocalScript, as if someone using this in a FE server, with RemoteEvents, this should be in a normal script. Miniller 336 — 12d

Answer this question