Hey guys. I’d like to know how I can prevent my frame from going “out of bounds”. If you don’t know what I mean, take an HP bar for example. You have the bar that indicates how much HP the player has, and the background which indicates how much HP the player is missing. That’s basically what I want, but because of the way the bar is scaled, it isn’t as easy to do. Sincere thanks if you decide to help me! Here’s my current code.
Just change the horizontal/verticale Scale property of the foreground bar as a ratio of the player’s current health to their maximum health, or whatever value you’re measuring:
You’ll have to apply that ratio to whatever scaling you are using. Just multiply whatever the scale is by that ratio and it should scale accordingly. If not, you may have to do some math trickery to make it work properly.