I have a stamina system, how can I make sure that when the stamina ends, the sound is played?
Is your stamina system by numbers? For example, does pressing a button drain the stamina number by 1 every second, and not pressing it add 1? If it is something of this effect, just get the value of it and check if it is 0 in a branch. If true play a sound 2D or at location to play the sound.
yes, that’s what I did, but with this approach, the sound is played several times until the value goes from zero to 1, and this happens for more than 2 seconds.
I’ve been doing this for 4 days, but in the end the solution is this: put “do once” in front of play sound 2d, and after 4 seconds in my case, reset the do once action.
Perfect! Glad it works.