Binding Progress bar to Variable

I’m having a real struggle binding my Progress bar to the Float Variable “Energy” I’ve created.
I have been following this guide over and over again step by step trying to figure out what I’m doing wrong. https://docs.unrealengine.com/latest/INT/Engine/UMG/QuickStart/2/index.html

The only thing different in my case from the tutorial is that I’m using a PaperCharacter instead of a FirstPersonCharacter. Is that the fualt? And if so… How do I get around it?

On this screenshot I show that I can’t find the Variable “Energy” in the Binding list.

On this screenshot you can see I’ve tried to make the “Energy” Variable appear in my Binding list.

If more screenshots are needed to be able to help me just ask for specifics and I’ll post them,

1 Like

From that drop down menu for Bind…click on Create Binding…this will create the binding that you can use to get the value from the character…in the new binding drag in the “MyCharII” variable and from it pull the pin and type “get energy” or “get *]your energy variable name goes here]” now if you have just the one Energy float variable and not a “MaxEnergy” variable you will need to convert the Energy variable into a 0 to 1 ration because the progress bar only works on a scale from 0 to 1 1 being 100% so now from the Energy node you just grabbed from you MyCHARII node divide that float by whatever your maximum energy level is in this case we will use 100 as an example for maximum level so divide it by 100 take the result of that and plug it into the return value of the return node of the binding. So in this example if your energy drops to 74 with a max level of 100 (74/100=.74) the progress bar will reflect 74% remaining energy.

You can rename your bindings as well in the panel…they are listed under functions just right click and rename.

1 Like

Ah, I seem thanks! But I did run into a new problem by doing this actually.
Is this just some kind of nameing problem?

No it is a reference problem what is the name of your player characterBP…Is it PaperCharacter?..if so from event construct instead of “get player character” use a “get player pawn” and then the cast and save to variable the “MyCHARII” reference needs to be a reference to your characterBP to get the values in it

My characters blueprint is named BP_Char
But I should still exchange “get player character” for “get player pawn”?

Yes and cast it to BP_Char instead of papercharacter then you should be able to pull the variables from your character’s BP

Indeed I was able to after those changes. Thank you so much!