Gui Object Tween Size acting weird

I’m trying to have my Ui object tween nicely into view using size, but the code I’ve put together does not work.
I’m confused because I’ve checked on multiple sources to see if I coded this wrong but couldn’t find anything.
It’s also late so I might be missing something really obvious :I

Heres the code

game.ReplicatedStorage.Events.ShowRoles.OnClientEvent:Connect(function(role, text, color)
	ImageLabel.Size = UDim2.new({0, 0},{0, 0})
	Role.TextColor3 = color
	Role.Visible = true
	ImageLabel.Visible = true
	Info.Visible = true
	Info.Text = text
	Role.Text = role
	wait(3)
	print("TweeningSize")
	ImageLabel:TweenSize(
		UDim2.new({0.352, 0},{0.814, 0}),  -- endSize (required)
		
		Enum.EasingDirection.Out,    -- easingDirection (default Out)
		Enum.EasingStyle.Quad,      -- easingStyle (default Quad)
		0.5,                          -- time (default: 1)
		true                     -- should this tween override ones in-progress? (default: false)
	)

	ImageLabel.Size = UDim2.new({0.352, 0},{0.814, 0})
	wait(7)
	ImageLabel.Visible = false
	Role.Visible = false
	Info.Visible = false
end)

It’s probably because of how you set up the 4 UDim2 values, try removing them from their tables.

Also, since you only care about the scale values, would be better to use fromScale

UDim2.fromScale(0.352,0.814)

Same applies for every time you do this in other UDim2s

Ahh, I thought about from scale but didn’t use it, thanks :smiley:
It worked, Thanks so much!

1 Like