How to stop sound on button click?

When the player closes a widget, they receive an incoming call and another widget pops up. When the widget pops up, I’ve spawned a 2D ringing sound. I added an “Answer” button so ideally when the player presses it, they can start the phone conversation. However, when the “Answer” button is pressed, the ringing sound doesn’t stop. What is one way to fix this?

2 Likes

place that disable sound on the button pressed branch and remove the boolean. Also, can’t you just use the “Stop” node?

Your BP doesn’t work, because the Event Construct is called just once, and therefore, when the button is pressed, even if you change the “is pressed” variable afterwards, it will have no effect in that already executed code.

1 Like