TweenPosition
For thread safety, this property is not safe to read in an unsynchronized thread.
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.
See also
GuiObject/TweenSize, tweens a GUI’s sizeGuiObject/TweenSizeAndPosition, tweens a GUI’s size and position synchronously
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 will override an in-progress tween |
||
|
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
This code sample demonstrates a more involved usage of TweenPosition by detecting when the tween completes/cancels by defining a callback function. It also prints whether the tween will play.