Widget and Sound dont stop looping(Solved)

Hello,
I have two big problems in my Shooter. I want on 30% Health that a Vignette and a Low Health sound pop up. But I want that the Vignette and Sound stops when The player is above 30% Health, but it´s not Working. After the Player fells under 30% The Sound and Vignette are still there(Endless). I spend Hours to fix it, but now I need your Help.

So here is my question: How can I stop them both from looping when they are over 30%?

Thanks in advance^^
Below is a Screenshot with my Blueprint(Maybe I´ve made a mistake)

How are you calling this - the execution wire that goes up up up?

Hello! As for SpawnSound2D - it returns pointer to spawned AudioComponent, so just use it to stop Sound.As for widget you can use Remove From Viewport

Hey,
Thanks for the Quick answer. Remove from Viewport has been replaced by remove from parent. And I dont know what do you mean with spawned AudioComponent. Do you mean that I schould drag out the return value and type in AudioComponent? I´m Sorry I´m new:)

Hey,thanks for the Quick Answer. It comes from a Branch.
It Checkes: Is the Health Equal to 0? If True set Dead to Checked. If False It Checkes if My Health is less than 30…

Right click pins and Watch values, play the game, observe the data. You’ll see where it fails. Use the debug filter at the top.

Hey,
Thanks for the quick answer, I´ve used the breakpoint, and looked where it stops working, but it stops nowhere.

replace playSound2D with SpawnSound2D - this has an output pin which you can use to stop the sound from beeing played.also you should not doing all this stuff onTick (I guess you do) - you should define custom events like “handle death (eg ragdoll, disable movement/shooting)”, “healthLow” (spawn sound and ui), “healthOk” (remove sound+ui) and call them after hit or healthpickup after you calculate new health.

looks good to me. can you add a breakpoint after the last branch where you check health > 30 on the first node (remove from parent) and check if that breakpoint gets triggered?
Also you don’t check for the case health is exactly 30 :wink:
and if you don’t clamp it somewhere else, you should check health <= 0 and not only ==0

Hey,
thanks for the Answer, I´ve got the SpawnSound2D, and the Event I use is the EventAnyDamage.(I´ve send you two more Screenshot if it helps)

Hey,
the breakpoint at remove from parent gets triggert right after i got attacked. And I replayced the “>Health” to “>=Health” Thanks;) Is it maybe because I enabled looping to the sound and widget?

Hey,
after i got hit ther happans nothing, if my Health bar is one third full my vignette and sound comes, and if I pick up the medipack(my Health bar is full) the sound and vignette is still there. Later I trie what U wrote and see what happens
Thanks :wink:

oh it lost the last part of my sentence ;D “you should check health not going below 0” - if it does, your logic is again blown up so clamp it in “decrease health” or check for <= 0. also - if your health is 100 and you got hit with 10 damage you will also go into the path health>30 - so you need to check there if the references to the sound and the vignette are valid - if you never had < 30 health they will not exist. so the problem still is if your health goes below 30 and then over 30 again the sound still plays and the vignette is still visible? or does the sound and vignette be visible/hearable after you’ve got the first hit and have more then 30 health? ok this app sucsk - I see different comment text when I write it against what it posts…hope you see more than my browser shows …

Hey I tried to look if my Health is going below zero( with Event tick and print string) but Everyrhing looks good I start with 100 and the sound and vignette shows at 30… but it doesn’t end.
And do you see the pictures i´ve send?