Download

Stamina bar that plays sound.

First off, I’m still new to UE and the whole blueprint thing, so I got what’s in the screenshots below from a youtube tutorial.

I copied a tutorial which had me add the Print String to show my stamina on screen and then play a sound when my stamina reached 20, I didn’t like the red text taking up the whole left side of my screen so I watched another tutorial that added a Energy Bar to the screen and depleted the energy bar when the character jumped. I edited it and called it Stamina and had it deplete the stamina bar when the player was running via holding SHIFT down.

My problem is, sometimes it will play the .wav sound file when the bar reaches 20 percent and then it won’t ever play it again, then again at times when I open my project it will not play the .wav sound file at all when the bar reaches 20%.

All I did since I didn’t know how to incorporate the 2 together, I just left the print string in the BP but I removed the option to Print to Screen, that way only my stamina bar showed.

Below is screenshots of what I have setup. And what I want to happen is it to play the .wav sound clip every time the stamina bar reaches 20%. ALSO on a side note, how can I make it not drain energy if the player is standing still but pressing the shift button? I only want the stamina bar to go down if they are moving, not every time they just press the button.

de4983fd154d8b8e52e8f0ab45aeb30d4cbf91c8.png

rN47TL4.png

8iW8x1l.png