Approximately 6 months ago, a change was made to the way humanoid health scaling works. The change made it so that the scaling is only updated when there is a change in humanoid health, rather than being constantly updated. This alteration was likely implemented for the purpose of optimization.
However, some games remove the default Health script as an optimization technique and/or preference. This means that without this default Health script, the humanoid health scaling can become irregular. While some games do not have this issue due to the default Health script, there are still quite a few games that may experience this issue (all of my games do as I do not use the default Health script).
Visual Aids:
Here’s a humanoid with Roblox’s default health script:
Default
Here’s a humanoid without it:
Custom (Default health script inside of player's character blank source)
(this humanoid healthbar is way too big)
I’ve made a local script under StarterPlayerScripts which kind of solves the issue for me:
print'running attempted irregular health fix'
local hums = {}
local function func(char)
local hum = char:WaitForChild'Humanoid'
table.insert(hums, hum)
end
game.Players.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function(char)
func(char)
end)
end)
for _,v in next, game.Players:GetPlayers() do
if v ~= game.Players.LocalPlayer then
if v.Character then
func(v.Character)
end
v.CharacterAdded:Connect(function(char)
func(char)
end)
end
end
while wait(1) do
for i,v in next, hums do
if v and v.Parent then
if v.Health < 99.9 then
v.Health -= 0.00001
end
else
if v then
v:Destroy()
end
table.remove(hums,i)
end
end
end
I’ve uploaded a very simple place file that can be used to reproduce this issue (includes the local script):
humanoidHealthScale-R6.rbxl (57.7 KB)
Expected behavior
I shouldn’t need to constantly update the humanoid health for a humanoid healthbar to scale properly.