Billboard GUI issue

Hey there! I have been getting a small issue with billboard GUIs and can’t figure out. This is probably a simple mistake but I can’t seem to work out why when I clone the UI onto the random spawning trees the actual healthbar keeps going weird.

What it is supposed to look like:
image

Issue:
image

And when it reaches a certain amount of health this happens:
image

If anyone has any idea of why this is happening and a solution that would be very much appreciated. ^^

Could we see the code that updates the size of the healthbar? That would be helpful to solving your problem. :slightly_smiling_face:

1 Like

What is happening is you are using an image for the green bar, and when the size is being changed the picture is getting distorted. A solution to your problem would be to use the frames that Roblox gives you. Though they aren’t as pleasing, it will make a huge difference when the bar is decreasing.

1 Like

I will update when my scripter is online ^^

I will give that a try but like you said it’s not really that pleasing so i’d rather use that as my last resort.

The solution to your problem has quite a few steps

  1. Create a new frame “Frame1” and make the size, position, and parent the same as the green health bar and make it transparent.
  2. Duplicate Frame1. This “Frame2” now needs to be parented to Frame1 with a size of 1,0,1,0 and a position of 0,0,0,0.
  3. Set clip descendants of Frame1 to true
  4. Make the green health bar a child of Frame2 and make it’s size 1,0,1,0 and position 0,0,0,0.
  5. Now it should look exactly the same as it did before this. Just in case I messed up somewhere.

And now for scripting changes. Instead of just resizing the health bar you now do this:

  1. get the amount you would have resized “resize_amount”
  2. make the position of Frame2 = the position of Frame2- resize_amount
  3. make the position of HealthBar = the position of HealthBar + resize_amount

This should make it so that it clips the extra part of the health bar instead of resizing it. I feel like there has to be an easier way, but this is all I could think of.

2 Likes

Ill give it a try thanks a lot ^^

local PAD = HealthValue.Value / MaxHealth
GeeYouEye.Background.Bar.Position = UDim2.new(PAD/ 2 + 0.01 , 0,0.5, 0)
GeeYouEye.Background.Bar.Size = UDim2.new(PAD - 0.01, 0,0.88, 0)
GeeYouEye.Health.Text = HealthValue.Value.. "/".. MaxHealth

sorry for late response

Perhaps you’re looking for something like this?