Scaling UI issues

i’m trying to make it where when you hit someone, a bar will increase it’s x size by 30. i’ve been trying to use tweensize but I keep getting told a UDim was expected, but when I use a UDim; nothing happens. i don’t know if i’m overcomplicating this…

code example:

local yes = UDim2.new(0,30,0,0)
print(script.Parent.Size + yes)	
script.Parent:TweenSize(UDim2.new(0,script.Parent.Size + yes,0,13),"Out","Quad",.5,false)

You can just do this:

script.Parent:TweenSize(script.Parent.Size + yes,"Out","Quad",.5,false)

by the way, this does not work because that is trying to increase a UDim2 by a numbervalue
(i attempted this before)

@Dolphin_Worm @ekuz0diaa If you still wanted to do it the original way, here is the fix:

script.Parent:TweenSize(UDim2.new(0,script.Parent.Size.X.Offset + 30,0,13),"Out","Quad",.5,false)

I prefer doing the way I posted in post #2, but it is your choice whether to do this or that.

1 Like