how to make energy decrease in UMG template?

All the logic about your mood, energy and what ever is normally located in your PlayerCharacter.

Most of the time, these values/setups follow a simple rule: You need a “MaxEnergy” and a “CurrentEnergy” value.

“MaxEnergy” is, of course, the maximum the energy can reach and “CurrentEnergy” describes the current value.

Now, inside of the UMG Widget, you will need a Reference to the PlayerCharacter. A simple “GetPlayerCharacter0” is enough for that. Make sure to use “IsValid” on the return value, before using it, since the Player could be destroyed (killed).

Now cast it to your own custom Player Class and get both Variables. All of this should be done in the Percentage Binding of the ProgressBar. Percentage goes from 0.0 to 1.0. So “CurrentEnergy” divided by “MaxEnergy” gives you your “0.0 to 1.0” Range, which you need.

How you actually decrease the Energy or mood (or what ever) is kinda up to you.

A steady decrease over time would be done by using the EventTick function of your Character.
You would do “CurrentEnergy = CurrentEnergy - DecreaseValue*DeltaSeconds”. Where DecreaseValue is up to you and DeltaSeconds are provided by the EventTick Function.

Cheers.