How do i use TweenSizeAndPosition?

Hello, How do i use TweenSizeAndPosition? I know how to tween for TweenSize, but how do i do it for both them being in one function?

1 Like

Tweening is pretty simple and easy to remember, use this format for all tweening. You can use both size and position.

local NameOfTween = TweenService:Create(ItemYouWantToChange,,  {PropertyYouAreChanging = TheValue})

So make a table called: local goals = {}
then set everything you want in there. Make sure the property name is spelt correctly, so example

local part = workspace.part
local goals = {Position =, 5, 15), Size =, 10, 6)}
then added all together you get something like this: 
local petSizeandPosition = TweenService:Create(part,, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut), {goals})

I’m using TweenSizeAndPosition for a Gui, its different, right? The code you gave me will still help me on a different project though!

Maybe this will help? GuiObject:TweenSizeAndPosition

Tweeing gui is no different at all you just add instead of vector and use the properties, Position and Size Example:

local frame = script.Parent
local goals = {Position =, 0,0.789, 0), Size =, 0,0.501, 0)}
local guiTween= TweenService:Create(frame,, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut), {goals})

The answers above are good, but I believe you’re specifically referring to this: GuiObject:TweenSizeAndPosition

If you’re looking to use that in specific, you can do the following:

local TweenToSize =, 0, 1, 0)
local TweenToPosition =, 0, 0, 0)
local TimeToComplete = 5

script.Parent:TweenSizeAndPosition(TweenToSize, TweenToPosition, Enum.EasingDirection.In, Enum.EasingStyle.Linear, 5)

In this example I did not use the override or callback parameters, but you can if you’d like.