Underwater breath meter
You would get better results if you broke this giant feature into a set of smaller questions and tackled them one at a time.
- How do you detect if a character / pawn is underwater
- How do you start/stop/reset a countdown timer
- How do you make a custom event fire when a countdown timer reaches 0
- How do you ‘kill’ the player character / pawn and display a game over screen?
Well i followed the stamina bar tutorial and set it as a breath value instead. It counts down to zero , then starts counting back up, thing is it starts the counting immediately even when i am not in water. And i am trying to get it so it kills the player if it hits zero , only if he is underwater. There was a “player died “ boolean in tbe character which i connected as a branch condition to a float at zero check, but he dont die. If i put a “ destroy actor” node in instead of that bollean , it will destroy the actor when it reaches zero. So i got it part worked out except killing the player at zero and counter moving only when he is in underwater.—————————————————————————————————————-That underwater detection link in your reply has a small blueprint about the check movement with a node that has “swimming” on it(node right after the check new movement) pin, i cant figure what kind of node that is or how to get it.
I set players health variable and his health goes to 0 at timer countdown but he still don’t die, he just walks around with 0 health.
Create a branch health <= 0, then on true execute your death scene or game over screen