The frame goes out of the margin

Hello scripters, I am making a level system, and I ran into a problem, it turns out that I use TweenSize to make a bar that indicates your experience, but the bar at the beginning of the animation goes out of the square that I had indicated, does anyone have any Any idea how I could fix it?

There is a script running this for the tween… in there you have the gradient bar that is green, it will be defined at the top somewhere, lets say “filler” in this example:

filler:TweenPosition(UDim2.new(0.619,0,0,0), Enum.EasingDirection.Out, Enum.EasingStyle.Linear, 7, true, nil)

You will want to move the starting UDim position so play with the 0.619 in this case.

2 Likes

that’s what I was doing, and this is precisely the error, here I leave what I put

GameGui.LevelUp.Line.Fill:TweenSize(UDim2.new((xp/10/10),0,1,0), nil, Enum.EasingStyle.Linear, waitTime)

Change this to ((xp/10/10),0,0,0).

Play with the numbers in the first and third spot and see how they change your fill location to see how it works. The first spot is the (xp/10/10) and usually this is just one number.

It doesn’t go outside of the “margin”. That’s just how UICorners work. Use clips descendants or start the UICorner frame as a square.