Make progress bar based on level distance?

Hello devs!

I’m trying to make a progress bar like Tower Of Hell, but horizontal. However, the length of my level is almost never the same. How would i make it so the gui is always properly positioned, based of the levels’ length?

Thanks in advance!

I think this should help with your problem. It’s a reply to a post from a while ago: How to make a stage progress - #8 by dodle120

The code isn’t the most efficient or cleanest, but I think you can make it better by using a :GetPropertyChangedSignal event with the hrp’s position instead of a while loop

Hey!

If you have a main frame, you can use percentages.

First, you need the total length from start to bottom.

(Bottom.Position - Top.Position).Magnitude

This will get you your total length.
Then you need to do the same for each segment, the segment start position and the segment end position.

After you did all this, the segment length devided by the total length is your frame length you need for the gui.

The last step is just aligning everything together and you’re done!

Cheers

Hello, thanks!

image

This is my current code but it doesnt seem to work. There are no errors tho.

Edit: i’m trying to change the position, not the size.

Another edit: Nevermind, got it working! Thanks a lot!