Choppy GUI tween?

Hey, so I am trying to make a gui progress bar tween, but the problem is that it is very choppy.

Ex. https://gyazo.com/56dcacc2e1e0a0f62a5d50bcbffa44d9

I would like be smoother while still retaining the same time. When I make the tween time shorter, it does become smooth, but I want the progress bar to take that long.

Here is my script:

local tweenInfo = TweenInfo.new(120, Enum.EasingStyle.Linear, Enum.EasingDirection.Out)

local tween = TweenService:Create(timerbar, tweenInfo, { Size = UDim2.new(0,0,1,0) })
tween:Play()
2 Likes

Try playing around with the other EasingStyle of Tweens, each one will still take 120 seconds to run through, but will alter the speed at which certain parts of the time bar will progress, with Exponential for example, it’ll start off faster and gradually slow down towards the end.
Given the large time constraint in addition to the limited amount of values that can be crammed into your UDim2 Y Scale, you’re not really gonna find a solution that works. You could try instead to run a while loop paired with a wait() to add a certain “chunk” of time to your progress bar, so that it loads in small blocks rather than slowly filling up all choppy-like. For example:

while timerbar.Size ~= UDim2.new(0, 0, 1, 0) do
     wait(12)
     timerbar.Size.yScale += (1/10)
end

That gives you 10 separate “chunks” of loading bar progress. But in all reality, what you’re seeking to attain isn’t really easily achievable given the current constraints. The number values Roblox provides aren’t really as precise as they need to be for your idea.

Edit: I might have the UDim2 size attribute references wrong, but I’m not currently able to pull up the proper reference for it, so you could also do:

timerbar.Size += UDim2.new(0, 0, (1/10), 0)
4 Likes

Hey thanks for the reply. I really wanted the progress bar to maintain accuracy in how much time had gone by vs. what was left, which meant that I really valued the linear style. While I could see letting it go in favor of smooth movement, the solutions you mentioned still result in the same choppiness, even if it happens later on instead of at first. Do you think that is possible?

1 Like

Sine is your go to for any general smooth easing. SineOut specifically.

1 Like

https://gyazo.com/a88d2a3ac7d05a48158e1b39f6783391

Just tested it! Seems to be a little choppy still.

Its hard to ease something so small, it literally comes down to decimals. Maybe itll have to be a stronger ease then in that case try Quad or Sextic

1 Like

I tried out quad but it doesn’t seem to fix it. The other style you mentioned doesn’t seem to exist. I wanted to see if there was any way that I could make the tween smooth even though the increment is so small.


try these and experiment go nuts

2 Likes

Play the tween through local script rather than the server. The server takes a while to process while client side is almost smooth.

1 Like

This is on the client side. Some extra text for limit

In that case, it pretty much depends on the user’s device resolution. The more resolution they have, the more pixels there are that will make it seem like it’s smooth. You can extend the UI to be longer to have a smoother effect.

1 Like

I feel like your issue is because of the fact the UI is very small, I don’t think there is a way to fix that issue to my knowledge.

How big is the bar? If the bar is small in width and it takes 120 seconds to complete then you will have choppy tweens as there is no in-between pixels that it can tween to, it will “snap” to the nearest pixel.

4 Likes

Yeah that makes sense. The bar is almost the length of the entire screen, and I’ve tried it out on a 24 inch monitor yet it still remains like that.

Try reducing the time it takes for the tween to complete, I’m more than sure this is due to resolution, even if it’s a 24 inch monitor, is it 1080p or 4K, etc?

2 Likes

I would do that except the time is essential the game I am making since it is a round based game lol

I’ve some ideas. Programming is weird and I believe they may work:

  • Try with other EasingDirection.
  • Make the bar bigger.
  • Make Size.Y.Scale = 2 and Duration = 240.
  • Separe your tween into several. i.e.: t1 progresses the bar to the first half within sixty seconds, then t2 progresses the rest within another sixty seconds.
1 Like

What is the resolution of your monitor?

1 Like

I’ve tried all the easing directions and they all do the same unfortunately. The bar bigger would work normally, but the bar currently covers the whole screen width. I’ll see if the y scale function will work. I’ve tried separating into many, but that did not work.

1440 p x 2560p i believe, but I want this to work on lower res screens as well.

This won’t work well unless you use scaling I guess, it won’t be able to be the same on all displays. Sorry I’m unsure what else you could do. There is simply not enough pixels to be tweened.

1 Like