PcoWSkbVqDnWTu_dm2ix
We use cookies on this site to enhance your user experience
Collapse Sidebar

TweenPosition

Smoothly moves a GUI to a new DataType/UDim2 position in the specified time using the specified Enum/EasingDirection|EasingDirection and Enum/EasingStyle|EasingStyle.

This function will return whether the tween will play. It will not play if another tween is acting on the GuiObject and the override parameter is false.

If you want to tween a GUI’s GuiObject/Size, you can use the GuiObject/TweenSize. You can also tween a GUI’s size and position at the same time using the GuiObject/TweenSizeAndPosition function.

Parameters

Name Type Default Description

Where the GUI should move to

Out

The direction in which to ease the GUI to the endPosition

Quad

The style in which to ease the GUI to the endPosition

1

How long, in seconds, the tween should take to complete

false

Whether the tween can be overridden by another tween before it finishes

nil

A callback function to execute when the tween completes

Returns

Return Type Summary

Whether the tween will play


Code Samples


Tween a GUI's Position

If the GUI is at UDim2.new(0, 0, 0, 0) and you want it to move to UDim2.new(1, 0, 1, 0), you would use:

GUI:TweenPosition(UDim2.new(1, 0, 1, 0))