Download

Is there a way to check if a sound is playing?

Hi all, in my game I have a door that is locked. I want it to play a “door locked” sound when the door is interacted with. The thing is, I want to check if the sound is playing so that it won’t repeatedly play the sound (“door locked”) when the door is being interacted with.

Thanks!

I’m pretty new to all this, but why do you need to check if the sound is playing? Wouldn’t it be easier to just use a DoOnce node to make sure it only fires on the first interaction?

Could you not just play the game and test if it’s okay? If you start of the blueprint with e.g. the F key, then the play the sound at location, it will only play the sound when the key is pushed for example

I’m also new, so I don’t know much :slight_smile:
Thanks! :smiley:

If you don’t want the sound to be played multiple times while closing or something, then you need to make sure (maybe use a doonce) that the sound is only played once until the door is read to be activated again.

Think about it like controlling that the door at all is only able to be used after it was closed/opened and only play the sound one using it, not directly on the key press.

All this depends on how the door works etc. If it’s slow moving door and you want the player not to be able to play the sound until it’s closed or something, then you need to control that with bools and doonce.