Hey! So I’m following this tutorial on how to create a Health/Ratio bar, and I followed the exact steps in the tutorial but it doesn’t work at intended.
As you can see in this image, the actual moving part (known as ‘Top’ in the tutorial) is in the middle. On the tutorial post, someone said they are having this issue but no fix was mentioned.
This is the code:
-- ///////// GUI STATS \\\\\\\\\\ --
function resizeCustomLoadingBar(sizeRatio, clipping, top)
clipping.Size = UDim2.new(sizeRatio, clipping.Size.X.Offset, clipping.Size.Y.Scale, clipping.Size.Y.Offset)
top.Size = UDim2.new((sizeRatio > 0 and 1 / sizeRatio) or 0, top.Size.X.Offset, top.Size.Y.Scale, top.Size.Y.Offset)
end
while wait(1) do
-- Ratio Bar
local RatioInfo = ReplicatedStorage.RatioInfo.Team1.Value / ReplicatedStorage.RatioInfo.Team2.Value
resizeCustomLoadingBar(RatioInfo, script.Parent.RatioBar.Clipping, script.Parent.RatioBar.Clipping.Top)
end
This is my structure:
Not to mention I also set the required properties in for the frames.
Thanks!