The TweenService is not doing very well [Solved]

Why is the TweenService not working? I already changed some of it and it wont fix the tween not working

		local Formula = (StaminaAmount/MaxStamina)
		Bar:TweenSizeAndPosition(UDim2.new(1, 0, Formula, 0), UDim2.new(0, 0, 1-Formula, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Linear, 0.1, true)

What is it supposed to do, fill the bar solid from bottom to top?

When your not moving it refills it but when you hold the Left Shift key while moving it will drain it

From the looks of it I am guessing its an issue with the anchor point since it is sizing to the top left. Make sure that the anchor point of the filling part is (0, 0) as well as making sure it has the same parent as the red stamina bar.

Fixed most of it but thanks

Can you show the hierarchy of the gui parts?
I feel you might have some sort of ration constratint or something in the inner bar

2 Likes

You can probably do something like this:

while task.wait() do
Bar:TweenSize(UDim2.new(1,0,StaminaAmount / MaxStamina,0), "InOut", "Quad", 0.2, false)
end

Strangly enough i removed them and it worked

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