Problem with recharge health and stamina

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


I have troubles understanding what you’re trying to do. Do you really want to increase the health only once after you took damage (after waiting of course)? I guess you rather want to recharge your health frequently but not while you’re taking damage. If you do, this should solve your problem:

Your branch checking if the player is walking, jumping or running is missing because that doesn’t make much sense to me related to health but you can keep it if you want.

Thanks you. Its fine. You helped me a lot :smiley: