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:
Issue:
And when it reaches a certain amount of health this happens:
If anyone has any idea of why this is happening and a solution that would be very much appreciated. ^^
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.
The solution to your problem has quite a few steps
Create a new frame “Frame1” and make the size, position, and parent the same as the green health bar and make it transparent.
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.
Set clip descendants of Frame1 to true
Make the green health bar a child of Frame2 and make it’s size 1,0,1,0 and position 0,0,0,0.
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:
get the amount you would have resized “resize_amount”
make the position of Frame2 = the position of Frame2- resize_amount
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.