#Custom health bar jittering on movement

1 messages · Page 1 of 1 (latest)

hallow narwhal
#

I have a custom health bar inside a cube model for a td im making. When the cube is moving the health bar seems very laggy and jitters to its position instead of moving smoothly, anyone got any advice?

hollow bluffBOT
#

studio** You are now Level 5! **studio

iron oyster
#

upload the code

#

anywhom

#

idk how this happens

#

upload the code

glad flare
#

guys we telepathically read his code

#

with our minds

#

cmon if we focus we can see it

hallow narwhal
#

Im not home rn, ill upload the code soon

hallow narwhal
#
local humanoid = script.Parent.Parent.Parent.Parent:WaitForChild("Humanoid")
local healthNum = script.Parent.Parent.HealthNum

humanoid.HealthChanged:Connect(function(damage)
    script.Parent.Size = UDim2.new(damage / humanoid.MaxHealth, 0, 1, 0)
end)

local function Number()
    healthNum.Text = humanoid.Health.."/"..humanoid.MaxHealth
end

Number()
humanoid.HealthChanged:Connect(Number)
#

@iron oyster @glad flare

glad flare
#

probably something with the line that changed script.Parent.Size

#

double check if ur doing the math right

#

its either that or the text is messing with the box

#

or its also possible that its moving strangley because you might have it handled on the server, which may have update delays

#

try:
check the math
check the text is not goofing off
try handling it locally