UI Gradient not scaling correctly

I was trying to make it so gradients aren’t “squished” when the UI scales, so I tried scaling the gradient with the frame and this keeps happening.

https://gyazo.com/5c8dae399b46d779147c254e1467c447

For some reason the gradient “bounces” before coming back to the right position, I tried using a math.floor() and math.ceil() , but neither of those seem to work, and I couldn’t find anything on devforum regarding this.


ProgressBar.Frame.Size = UDim2.new((math.round(Progress * 100)/100),0,1,0)
ProgressBar.Frame:FindFirstChildOfClass("UIGradient").Offset = Vector2.new(1 -ProgressBar.Frame.Size.X.Scale,0)

Here is the code I am using to scale the UI

I think this may be a floating point problem, but does anyone know a fix? I would greatly appreciate it.

I really need some help on this, I don’t want the scaling to be uneven.

can you argoment more on your problem?

So, the gradient’s scaling doesn’t seem to be linear with the actual UI, as shown in the video. The bouncing effect is the gradient seems to be more stretched out at first, but at around halfway through the scaling it starts to compress to where it should be.

What I WANT it to be, is that first of all, the gradient doesn’t get “squished”. And 2, I want the gradient to essentially stay still during the entire scaling process.

Why don’t you just use a frame with a clip descendant that move from the left to the right?

Hmm, seems plausible, ill go and try it.

It will be so much easer. If you need help just ask me!

This actually worked. Thank you!

I hope you learned something new!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.