I don't know how to make the UI tween from left to right depending on the value of "CurrentEnergy"
-- Energy -- local CurrentEnergy = char:WaitForChild("CharacterManagement"):WaitForChild("CharacterStats"):WaitForChild("Energy") local MaxEnergy = char:WaitForChild("CharacterManagement"):WaitForChild("CharacterStats"):WaitForChild("MaxEnergy") ------------ CurrentEnergy:GetPropertyChangedSignal("Value"):Connect(function() local healthChange = CurrentEnergy.Value/MaxEnergy.Value healthGui.EnergyBarUI.MainEnergy.AnchorPoint = Vector2.new(0.5, 0.5) healthGui.EnergyBarUI.MainEnergy:TweenSize(UDim2.new(healthChange,0,1,0),"In","Sine",0.05) end)
This is what happens when I attempted to have the UI trying to go left to right: https://media.discordapp.net/attachments/833569929696509972/878152211182530570/BiggestFail.PNG
Use anchorpoint. Set it to 1,0,0,0 and then it will increase towards the left and decrease towards the right, which is flipped.
change
UDim2.new(healthChange,0,1,0)
to
UDim2.new(0,healthChange,0,1)
because you change offset it wont work, so you must change scale.
I just found out it was so simple... I just had to make "EnergyBarUI" Rotation 180 inorder to make it go left to right.