Making a UI image move to a certain value along a meter

Hi all!

I am currently trying to make a UI widget where a circle will move to a certain point on a bar that is linked to a certain value. I currently have it set up to a normal progress bar, however because they use a value of 0-1, I can’t get the effect i’m after.

There is a variable which holds the max amount of pick-ups in the level, and the current pick-ups that still need collecting. I want each end of the bar to represent the max amount of pick-ups in the level, and the centre of the bar to be 0. As the player moves about the level, more pick-ups may pop up as they are collecting others. The idea is that the bar will slide back and forth between these values, almost like a balance meter and the player is trying to find that sweet spot in the middle.

Hopefully the images below better demonstrate what I mean.

The current bar which is a regular progress bar that depletes as items are collected:

What i’m trying to make: (the player wont be able to see the numbers and the white circle represents the current number of pick-ups left)


What determines on the circle’s direction? If there are 6 items left on the level to pickup (your last image), why would the circle go to the right over the left? Just trying to understand your question better :slight_smile:

The bar is supposed to represent a stress bar where the circle goes back and forth to appear like a balance bar where the player has to find that sweet spot in the middle which would be ‘0’ or that ‘zen’ moment. Having a 6 on either end where the circle will go to either at random when there are 6 items left was the only way I could think to simulate the balance bar feeling i’m after.

Of course i feel like i’m overthinking it, so i would be open to anymore suggestions on how to achieve this instead :slight_smile:

If the level starts with X pickups, will the max number of pickups that spawn on that level always be **X **or is there a chance that you could start the level with **X **pickups but some point during the game you could end up with X+n?

It is possible that you can start the level with X+n , I thought it would be better to have the end points of the bar at 6+ instead of 6 because it is possible for the value to go above that in multiple levels :slight_smile: