How do i make my character lose energy when they jump?

so ive attempted to make a basic player status system with a health, energy, and mood bar. when my player jumps i want them to lose some energy. i have attached an image of the setup i have for my jump action. i have the health bar set up and it should all be working but i’m not sure where i’m going wrong. if you need to see any other parts of my work please ask. thank you!

What exactly doesn’t work as expected?

it dosent take any energy off the bar in the game.

How did you do your visuals then?

this is the event construction for my player status do i need to add anything to this?

Yes the function you used to bind the energy to your energy bar.

Since it’s always 0 it means it’s not hooked up properly and doesn’t receive the value.

so what would you suggest i do, if i change the value to 1 would this fix this.

Please show me how you did it because right now I suspect you have no working connection between your player and umg meaning it’s impossible right now to display your energy on screen because your screen can’t see the variable energy.

The interesting part is the script of the umg graph itself where you bind a variable.

is this what you need to see? this puts my player status on the screen.

oh sorry im new to UE4, the only other thing i have is this.

how do i do that?

Did you check if you actually successfully casted your character and if the variable “my character” is properly filled?

There is a pin in the cast node called “cast failed”. You can use a “print string” node to check that.

Or use the node “is valid” right before you use it and plug give yourself an error message that way.

i dont understand what you mean. do i need to plug in the print string node to the cast failed? if so then what should i do

your progress bar in umg needs to look something like attached.

your question title isn’t correct. You want help making the progress bar deplete, you’re stating you already have the variable depleting when you jump right? these are two separate things, it won’t deplete the progress bar even if set up correctly unless its depleting properly in your characterBP to start with so make sure when you jump in general that the value is actually depleting as per your characterBP. Also progress bars need to be set in percentages, hence the X 0.01 (100% of 100) (divide 1 by the max energy number to get the percentage right)

I attached an example, but if you don’t understand the basics of casting, you need to take a step back and walk through some beginner tutorials. Its not important that you get the copy and paste code you need right NOW. It’s important to understand what it does and why, so you can build your own stuff.