Help with Custom Health Bar

What would be a more efficient way to make a “choppy” effect on the shield Bar? (Circled area)

help

image
The current method

The way this was done was by using UI gradient, but obviously it would take ages to make it perfect, and I want it to be able to scale (like if you have more shields, it’ll add more of the lines to make the notches look smaller)

1 Like

I would use a script with a variable that takes the amount of shield you want, then divides it by a number like 5. Using that number you could instance a frame of the size you want, then move it by an offset to create a staggered effect. It could look something like this:

local shieldSegmentAmount = shieldAmount/5

for i = 0, shieldSegmentAmount do
local Frame = Instance.new(“Frame”)

Frame.Position = UDim2.new(i/10, 0, 0, 0)

end.

If you do not plan on dynamically changing the look, then just use multiple frames offset different amounts.

I hope this helps a bit!

Alright, I’ll look into this, thank you!