I need help in making it that once my stamina (energy) reaches 0, I am not able to move any more, and to recharge energy you have to click one of the buttons seen below to sleep.
- You need to create a variable for your stamina, use a float type
- Set it’s value to 1
- Bind the progress bar value to your stamina
- in your character bp, use an event tick node to decrease your stamina over the time
- Create a branch node to controler if your character’s stamina has reached the value 0, if true, set its movement mode to ‘none’
- on the button sleep click, set your char’s stamina to 1 again, and the movement mode to walking