Need help with a healthbar!

So here is my healthbar

So my ui Artist mentioned with health going up and down the green part will stretch super weird and not work since the left side is an odd shape. This is to display player’s level in that gap.

Anyways I think I have an idea to to fix this. Instead of the green part being an odd shape it could just be a rectangle. Now you’re probably saying, oh but it’s gonna clip through? I have a solution though, and that’s using clip descendants. What I want to know is if clip descendants would work in this case? I heard it only works with specific things
.

I recommend you read this Roblox Documentation that will help you find out more about Clips Descendants

task.wait(2.3) -- Depends of how long your game takes to load entirely

local Humanoid =  game.Workspace[game.Players.LocalPlayer.Name].Humanoid

while task.wait() do
	script.Parent.Frame.Frame.Size = UDim2.new(0.98*Humanoid.Health/Humanoid.MaxHealth,0,0.8,0) -- Obviously, change it to what you have.
end

Make sure that the player regenerates every second.

task.wait(2.3) -- Depends of how long your game takes to load entirely

local Humanoid = game.Workspace[game.Players.LocalPlayer.Name].Humanoid

while task.wait(1) do
	Humanoid.Health = Humanoid.Health+(Humanoid.MaxHealth/100)
end

You could use 9-slice to avoid the distortion UI 9-Slice Design | Roblox Creator Documentation

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