Gui Size Tweening not Working

So I am making a game with a leveling system. I am making a GUI expanded and pop up on the screen using the tweening service. The position is working however the size is not. Been looking around but haven’t found anything. Any help will be appreciated.robloxapp-20211019-1926517.wmv (1.1 MB)
I want the box to size out as well, there are no errors in the output and the script is:

local TweenService = game:GetService("TweenService")

local demo = frame.Parent:FindFirstChild("Demo")
local demo1 = frame.Parent:FindFirstChild("Demo1")

local tweenInfo1 = TweenInfo.new(1.5, Enum.EasingStyle.Sine, Enum.EasingDirection.Out)
local tween1 = TweenService:Create(frame, tweenInfo1, {Position=demo1.Position}, {scale = UDim2.new(0.016, 0, 0.277, 0)})
local tweenInfo2 = TweenInfo.new(2, Enum.EasingStyle.Quart, Enum.EasingDirection.InOut)
local tween2 = TweenService:Create(frame, tweenInfo2, {Position=demo.Position}, {scale=UDim2.new(0.424, 0, 0.277, 0)})

---- In a function that is fired when you level up

		tween1:Play()
		
		frame.BackgroundTransparency = 1

		tween1.Completed:Connect(function()
			wait(0.5)
			print("Tweening")
			tween2:Play()
		end)

Thank you

1 Like

:Create() accepts 3 arguments (instance, tweenInfo, propertyDictionary)

You are currently passing 2 dictionary tables, also size of GUIs is Size, not scale

local tweenInfo1 = TweenInfo.new(1.5, Enum.EasingStyle.Sine, Enum.EasingDirection.Out)
local tween1 = TweenService:Create(frame, tweenInfo1, {Position=demo1.Position; Size = UDim2.new(0.016, 0, 0.277, 0)})
local tweenInfo2 = TweenInfo.new(2, Enum.EasingStyle.Quart, Enum.EasingDirection.InOut)
local tween2 = TweenService:Create(frame, tweenInfo2, {Position=demo.Position; Size =UDim2.new(0.424, 0, 0.277, 0)})

Also GUI instances inherit these functions :TweenSize(), :TweenPosition(), :TweenSizeAndPosition.
You can search them up on DevHub, you could use them instead of TweenService.

1 Like

Yeh, sorry, I had scale because I tried it (of cause didn’t work) and forgot to change back to size (which is what i have been trying this whole time)

1 Like