How to make a progress bar and it increase when picking up items?

In the project I am making, you are picking up “tickets” and there is a total of 6. I want a progress bar at the corner to let them know how many tickets are achieved. I’ve looked up tutorials on how to, but cannot figure it out. Most tutorials are Health and Stamina progress bars. If anyone could help me out on this, I would appreciate greatly! Thank you!

Hey !

To do this it’s fairly simple :slight_smile:
Create an int or float and set the max amount of tickets in there(or total) and call it “MaxTickets”. Then create another one which is “ActualTickets” and then to get the progress percentage do ActualTickets devided by TotalMax which will give you a value between 0 and 1 which is how Progress bars work :slight_smile:

Below you can see the image of what i mean :slight_smile:
Hope it helps!

Do I Make this Blueprint is the Pickups Blueprint or make a new class Blueprint?
Thank you!

Hey!

You want to click the Bind button on the details tab next to percent when you have the desired progress bar selected. Then it’ll create that function and in there just cast to the character and use the 2 floats you created.

85593-screenshot_61.png

I did exactly like the photo and explanation. But I compiled and played, though it still is not showing on screen. And I did do the Bind next to the percentage. It’s named “Get Percent”

I appreciate all of your help! :slight_smile:

Would you mind showing what you have now?

And these are the “tickets” that you walk over and pickup
THank you for all of your help!

Hey!

You should cast to wherever you are doing the tickets logic. Either your character, player controller, an actor, wherever. Then cast to that with a valid object as input and use the values from that blueprint.

Would you mind showing an example?

I’m having the same trouble. And I’m doing tickets to and my blueprints are just like

Try something similar to this

This makes definite sense. I thank you for this!

One problem though. It still does not show up the progress bar. The only difference I made was the key binding being Left Mouse Click. But what I actually want is that My “tickets” get picked up whenever I collide with them. As you see on my last photo, The objects are already made and whenever I collide with them, they get destroyed.

To add the tickets just call the event or get tickets and do + 1 before destroying.

In the blueprints of the collision :slight_smile:

In the Progress bar bind or my Blueprints for my collisions?

Okay. That makes sense :slight_smile:
So I keep the Progress Bar Bind? And if I do a +1 for every collision before destroying it, how does it know there’s a max of 6?

Yup that’s exactly what you do!
The Max is just a variable you create and setting the default value to 6.
And you can either do a branch (ActualTickets => 6) or when setting the variable clamping it between 0 and 6.

Something like this?

Yup exactly :slight_smile: