How to tween gui in a certain direction?

image

local hp = math.clamp(number / maxNumber, 0, 1)
local tweenInfo = TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut, 0, false, 0)
local tween = TweenService:Create(bar, tweenInfo, {Size = UDim2.fromScale(hp, 1, 0, 0)})
tween:Play()

How would I make it tween like that?

Use AnchorPoint (0, 0) and Position (0, 0) if you want the green bar to stick to the left edge or AnchorPoint (1, 0) and Position (1, 0) if you want it to stick to the right edge. Then you can just tween the size from 0% to 100% of the width