Problem with health bar

Hello devforum, I just made a quick health bar. I have a problem with it. It scales on the two sides and since I don’t have much experience with UI scaling I am not sure how to fix that.

This is the script I am using:

local player = game.Players.LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()
local hum = char:WaitForChild("Humanoid")

local thing = script.Parent.Size.X.Scale / 100

	if Health <= 0 then return end
	local thing2 = thing * Health
	script.Parent:TweenSize(, script.Parent.Size.X.Offset, script.Parent.Size.Y.Scale, script.Parent.Size.Y.Offset), Enum.EasingDirection.In, Enum.EasingStyle.Linear, 0.45)

Thanks for reading!

Tween the position left or right, so it looks like one side is going down only.

1 Like

How do I tween it to one side only?

Try to change the anchor point to 0,0?

1 Like

Your anchor point is probably set to 0.5, 0.5. Try changing it to 0, 0.


Instead of doing that I suggest messing around with the AnchorPoint. As the AnchorPoint soul purpose is to be able to resize a part while it still being in the same position.

1 Like