Health and Progress Bar Pro

This is the thread to put in all information, announcements and questions into one place. This first post will be updated as we go along. Feel free to follow or reach out to me on twitter at @mnerurkar.

BUY NOW

What is Health and Progress Bar Pro?
If you want a good looking and useful ui bar, whether horizontal, vertical or circular, then you’ve come to the right place. The Progress Bar Pro asset contains a number of simple drag and drop prefabs that you just need to drop into your UI canvas. Updating them is as simple as calling a simple method. And if you don’t like the given bars, there’s lots of flexibility in the scripts to quickly create your own with existing components or to extend it with new functionality.

  • 15 pre-designed progress bars and more to come…
  • Smooth bar animation
  • Preview of final value during animation
  • Change bar color based on fill value
  • Flash bar on value gain or loss
  • Dynamically placed text

INTERACTIVE DEMO
Play around with the bars and see how they behave

The bar is currently on sale for it’s launch discount. As I add more features, functionality and prefabs, the price will increase accordingly. So grab it now!

Here’s a look at the different visual options:

And here’s an overview over how to create your own bars:

BUY NOW

Known Issues
If the bar is set to animate but you’re updating it’s value every frame the interpolation methods inherent to the animation will lead to the bar not moving properly towards it’s new value. If you’re updating regularly, simply deactivate the animate flag. This is something I’ll look to solving in a future release.

More coming soon, stay tuned.

Looks great - bought it :slight_smile:

Thanks! If you’ve got any questions, let me know. Same for feature requests or prefab bar ideas. Also if you’ve got time for a review, I’d greatly appreciate it!

I already have a noob question:

I use a standart Unity Slider for the Experience of the Player Character.
The slider is updated like this:

public SliderExpSlider;

public void RefreshExp(int exp, int maxExp, bool ingoreMaxExp)
        {
            if (!ingoreMaxExp)
            {
                ExpSlider.maxValue = maxExp;
            }
            ExpSlider.value = exp;
}

My approach to use your Progress Bar:

public ProgressBarPro ExpSlider;

   public void RefreshExp(int exp, int maxExp, bool ingoreMaxExp)
        {
            if (!ingoreMaxExp)
            {
                ExpSlider.SetValue(exp, maxExp);
            }
            ExpSlider.SetValue = exp;
 }

Please don’t laugh :stuck_out_tongue:

Well it depends on what sort of values you expect, and how you want the behavor the behave when maxEXP are ignored. That is what’s slightly confusing me. So everything within if (!ignoreMaxExp) looks good - you’re updating with ints with a current and a max value.

But the other one doesn’t work. It’d either be “SetValue(exp)” but it then expects a value from 0-1 which doesn’t really work there. I’m presuming you don’t want to set a new maxExp value in that case? The solution would be to save the last maxExp value and use that in case of ignoreMaxExp. Sorta like:

int lastMaxExp;

public void RefreshExp(int exp, int maxExp, bool ingoreMaxExp)
{
    if (!ingoreMaxExp)
    {
        ExpSlider.SetValue(exp, maxExp);
        lastMaxExp = maxExp;
    }
    else {
        ExpSlider.SetValue(exp, lastMaxExp);
    }
}

This may or may not be the best solution to what you’re trying to do.

It works! Thank you Sir. Looks great in action :slight_smile:

1 Like

Glad you enjoy it. As mentioned, if you find time to write a positive review, I’d greatly appreciate it!

Done!

Much appreciated!

Does this allow for circular fill sliders like a rev counter type fill.

It allows circular bars.
This is my result:
Circular handles the exp and the horizontal health and stamina

2 Likes

Awesome looking stuff there! :smile:

I have two questions:

#1 I use the CircularSimple as my starting point. In the demo scene the handle is working fine. When i pick up the prefab the handle stop working. It just stays in the same place and i can’t figure out why.

//Edit: Ok, found that one. It has to be inside a Grid Layout Group

#2 I replaced the Text compoment with TextMeshPro object. It works fine but throws errors at me:

NullReference:
PlayfulSystems.ProgressBar.BarViewValueText.UpdateView (Single target Value) (at .....BarViewValueText.cs:20)

Hey HellPatrol, it doesn’t have to be in a layout group, but it’s parent needs to be of the proper size for it to work. You may also have to work with the offset slider. The handle uses the size of it’s parent to position itself. The CircularSimple root object is forced to be 256x256 by the GridLayout in the demo scene. It has to be that size even without the grid layout, then the BarHolder has the same size and the handle, that’s a child of the BarHolder can then position itself accordingly. And if BarHolder would end up being width 0, height 0, the Handle can’t animate.

Make sense?

And as for the second error: If you want to change the BarViewValueText from TEXT to TEXTMESHPRO, all you need to do is

a) add the reference to TextMeshPro

using TMPro;

b) change line 9 (or so) from

[SerializeField]Text text;

to

[SerializeField]TextMeshPro text;

c) change line 57 (or so) from

[SerializeField]text = GetComponent<Text>();

to

[SerializeField]text = GetComponent<TextMeshPro>();

d) updated the reference in the gameObject to now point to your TextMeshPro object.

1 Like

strange, i’ve done it that way. And it works, but I get this error at start. :frowning:

Hi, cool asset!

Does it support Text Mesh Pro?
I want to add advanced player name style to the health bar :slight_smile:

It should, but as HellPatrol mentioned he’s been getting some issues.

As said above, what you need to do is go into the “BarViewValueText” component and change all “Text” to “TextMeshProUGUI”. Of course if you then use any of the prefabs they will be broken and you will have to restore them.

An alternative would be to add a new BarViewValueTextMeshPro and use that on your own bar designs, or replace that in the prefabs you’re using.

Playmaker actions?

I’m guessing you’re asking if there’s any available? Currently not. It’d be pretty easy to use with the existing playmaker actions as you only need to call a specific function on the progress bar with the 0-1 float as a parameter.

Hi Martin, thanks for Progress Bar Pro. It’s great overall!

I do have a problem on Android. Sometimes (perhaps once every 5 or 10 times), the progress bar with glow will freeze right at the max glow. Then all Unity input will stop working, but the game continues running otherwise. Have you see this before?

From web research, this is the closest possibly related thing I’ve found: [5.3.0]Occasionally freeze on Android devices - Questions & Answers - Unity Discussions

Any help much appreciated!