Issues with tweening size and health num

I know this question been asking a lot of times but i have been the most issues, i tried every solution in here, but some of them caused my “bar” to go offscreen and be more stretched.
Here is the result i wanna look for:
A smooth tween that slowly “decreases” or goes back.
Like this:
image

local maxhealth = humanoid.MaxHealth
local health = humanoid.Health
tween = tweenserv:Create(bar, TweenInfo.new(0.5, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {
			Size = UDim2.new(0,-health / maxhealth, 1, 0), 
			BackgroundColor3 = bg
		})
local maxhealth = humanoid.MaxHealth
local health = humanoid.Health
tween = tweenserv:Create(bar, TweenInfo.new(0.5, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {
			Size = UDim2.new(health / maxhealth,0, 1, 0), 
			BackgroundColor3 = bg
		})

(if it doesnt move then use a loop to update the health variable)

Tried it and got this.

is the yellow bar parented to another frame?

No it’s only parented to a screengui.

it should be parented to another frame (i promise it makes it so much easier for you to edit it)

so like make a frame the same size as a full bar, then parent it and it should work

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