Progress bar is glitching

Making a gui that acts as a progress bar, the errors is shown in the image:

The code is this:

local temperatureScreen = script.Parent

local barFrame = temperatureScreen.BarFrame
local bar = barFrame.Bar

local title = temperatureScreen.Title
local temperature = temperatureScreen.Temperature
local status = temperatureScreen.Status

local config = temperatureScreen.Configuration
local tempValue = config.Temperature
local maxTemperature = config.MaxTemperature
local interval = config.Interval

for i = tempValue.Value, maxTemperature.Value, interval.Value do
	tempValue.Value = tempValue.Value + interval.Value
	temperature.Text = tempValue.Value .. "°C"
	bar:TweenSize(UDim2.new(tempValue.Value / maxTemperature.Value), 0, 1, 0)
	wait(1)
end

Why is the Y scaling going to 0 when it is being set to 1 in the script?

1 Like

You just placed the paranthesis wrong, this is what you should do:

bar:TweenSize(UDim2.new(tempValue.Value / maxTemperature.Value, 0, 1, 0), "Out", "Quint", true)
2 Likes

Pretty sure you need to specify other arguments for TweenSize like time, EasingDirection, etc

1 Like

If there are no arguments specified, it automatically assigns them.

1 Like

What is the default time argument?

1 Like

This is just a guess, but I think it could be 0.5 seconds?

1 Like

You have just solved an issue I have had for days, and it was very simple. Thank you!

2 Likes