I’ve setup a system for lose stamina on run and lose health on take damage. Until here all ok. The problem came on the regenerate status.
The player must be able to increase his stamina (if is under 100) when the movement velocity is equal to 0, but to increase must wait x seconds. This process must to happen each time that the player lost stamina: 1. Wait x seconds, 2. Increase stamina.
I tried the same with the health system, both are not working. They’re only able to wait x seconds one time until increase, and after the stamina/heath regerenate immediately.
The smallest example that I can show in a image is the health increase.
Its able to increase the value on lose health, but with some problems: It increase the value while is taking damage and it increase without wait x seconds after take the damage.
Here, I solved the problem of increase the value while is losing health; but the value still in “true” when is not taking damage, so its not able to increase health anymore